- is$ T1 I5 r7 @8 M
- r:real; file:string;
9 H6 ?* M C4 ?! _8 K x/ D - do
' u' Z" r: y( f( E& k# K - openConsole;
$ }( M' e* x' J2 {# W! Y! |" y
X$ s# Z& O; F! L/ [$ y k" x- /*
& a( ~! r1 @. C - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",( c+ V/ M3 v) Z
- when is64BitApplication then 64 else 32,5 g0 j/ } I1 t1 y% R
- "bit.dll");
+ E0 h. f( ]5 t/ } b; H - */
9 g3 v h9 f' U( N8 x' p - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";$ A. q5 I0 s6 ~0 [
- local j := loadLibrary(file);
7 s$ O1 j2 W" s. N$ Z; a2 C) M - 4 `; _: [, }+ L
- if j > 0 then
$ |% a. r3 o5 @) b" f. K - print getLoadedLibrary(j)," is loaded.";
. Z8 t$ Z( Q" C" B6 j# {) j* a. k- R
) L1 |" w3 t. X3 O6 l/ V9 Z8 _- r := callLibrary(j, "calcSin", PI/6);6 B, p7 a* u+ I3 L; R( P
- promptmessage(to_str("sin(PI/6) = ", r));7 k) a( f; X3 M0 \4 S, R5 Y- v
-
" C) h* w0 O m0 I, F9 @6 g - local str:string;3 }3 E4 q7 v( d
- str := "I'm OK!";' ?) p# | c" ~* F, k
- str := callLibrary(j,"resetStr",str);
( S2 C! W- k0 x1 S - promptmessage(str);
. b3 e6 {" ?5 L6 ] -
X) i6 x1 i2 Q' I" u - callLibrary(j, "listAccess", Tablefile);7 A2 d9 P( D& t/ ~1 A
-
3 a" w8 H e( ^ - print "Unloading: ", freeLibrary(j);, t1 z: O: E$ ^$ y$ Z
- end;" x1 Y) E$ D2 b1 K
- end;
( G3 u N' K6 Y$ I. R5 b0 J
复制代码 |