- is1 M- t+ q, R8 }
- r:real; file:string;
- z1 Y2 J0 r5 \- w; k6 `7 ~8 f - do
1 ?% a, ^8 c& u" @0 ^ - openConsole;
; m# B, @+ x/ ~: X3 e3 O) u) x' s- x. K - 3 P. W3 h: x' C0 i/ R
- /*
8 x0 V7 ^: S: V& p4 |0 F- J - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
! f* M5 A+ W/ o# o( h, u - when is64BitApplication then 64 else 32,
& W& ?" {8 r, Y" N7 ? - "bit.dll");( d2 t: V* F0 ?4 W
- */
$ h9 s$ E' s) g( L& R - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
+ F6 }9 [- e! n4 e+ L9 E' k - local j := loadLibrary(file);$ B% L& }) w! W* C/ ^
# z0 K* ?. `; I) M" M5 l- if j > 0 then5 i2 K! I; V1 S b0 _" ~* K
- print getLoadedLibrary(j)," is loaded.";+ |1 S9 c) K1 X6 }7 }
# Z6 j* P5 j5 x2 O! x! m. I( d- r := callLibrary(j, "calcSin", PI/6);4 d' z% f" t; [! u
- promptmessage(to_str("sin(PI/6) = ", r));9 ]+ k: F, b2 ]1 p4 A- v1 p/ I
-
7 P6 o7 a* P3 r4 ` - local str:string;1 \) d2 T& M) Q. e/ S, ^2 B
- str := "I'm OK!";
3 G" m9 C$ @6 ~ - str := callLibrary(j,"resetStr",str);
- o6 k) a7 m/ N - promptmessage(str);
9 a6 W7 P7 M( d -
2 [* Q- D7 G3 _- y - callLibrary(j, "listAccess", Tablefile);
8 F' j3 a9 \% H- ?( C" o6 k - $ d. X" \' u8 e& C
- print "Unloading: ", freeLibrary(j);
. X3 H0 b7 M3 Z+ U - end;: o4 ]) G, N' b' [8 ?$ h( g! G
- end;0 ^" }0 }/ O& L
复制代码 |