- is9 ^: v# \8 A/ @6 E7 J9 h) s3 k1 l
- r:real; file:string;
8 z0 o( s v7 w6 U- f2 D - do: b/ g+ _. `/ f" K( Y5 X
- openConsole;
. G# L1 i- U. g9 u9 @( G
7 w. R) N) h7 o8 j" z6 ]+ g0 N- /*
- |. f- G/ `( d& |& P8 S( M n - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
1 N# p& ?6 F0 o: N/ ?3 |$ e - when is64BitApplication then 64 else 32,
6 i7 f+ x2 ~( K - "bit.dll");
$ T; f6 T, s* M4 D8 N6 ^ - */
2 @, W7 I" }# k - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
1 A7 p6 E+ ^5 ?3 ]! f4 k - local j := loadLibrary(file);
: ]4 |/ t5 e9 |: Y7 e# Q
$ B8 |: f( l2 q! x- if j > 0 then
1 p4 k$ e. m( B! v* d - print getLoadedLibrary(j)," is loaded.";' t' z2 \7 ^1 R- I5 S
- 9 E% A7 ?* Y+ X+ c, N- t
- r := callLibrary(j, "calcSin", PI/6);/ q$ }2 E7 P; l& _
- promptmessage(to_str("sin(PI/6) = ", r)); b8 F6 Z* }/ i' c
-
4 l( x+ g" j) ` - local str:string;, d1 y8 f' H5 k! T9 V3 \
- str := "I'm OK!";% F, S0 a6 _5 s. i
- str := callLibrary(j,"resetStr",str);
0 R! Z, S& ~9 e; f" K+ S: Z1 W, ~ - promptmessage(str);8 z# W6 ~6 e6 ? r
-
6 O M" Y$ M( B% I - callLibrary(j, "listAccess", Tablefile);6 N, Y; X- N7 V) F0 s
- ( E, @+ E0 F* r1 k4 Z: M
- print "Unloading: ", freeLibrary(j);5 N( v# M$ B3 w! r
- end;
% |1 P+ L* I" G - end;
) e+ v, v& I0 {6 O1 A# o
复制代码 |