- is
. `( @( }0 B2 } f - r:real; file:string;! Z( t- h( s+ M6 l; l1 X
- do
W7 u' |4 ~, d. Y2 E# e - openConsole;
: t; A1 ~8 } b3 y( o$ K
) O- @" m: r# X+ a. U- /*/ ]- Z8 [: b, F; a
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",$ u. Y& Y7 W0 b9 b
- when is64BitApplication then 64 else 32,$ t5 ]6 p; o3 ]5 D
- "bit.dll");% A! }. F" \+ K+ ], T
- */7 [( H, W# |, n% y
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";6 K7 R7 v: D' L, l$ Y5 K
- local j := loadLibrary(file);
3 o; K; W. E5 v7 y+ @
$ r6 D7 @$ v( L. m$ o. O4 a- if j > 0 then
$ |7 a$ g! ~9 w2 G' u - print getLoadedLibrary(j)," is loaded.";
- v' V6 T% {3 [2 r8 Q7 P6 c. ~& D
. B- j6 f2 x; R# i" v6 j- r := callLibrary(j, "calcSin", PI/6);+ J0 r* b( Z! ]0 I4 h8 r7 ?; a
- promptmessage(to_str("sin(PI/6) = ", r));1 U3 P2 C* i1 C1 ?
-
1 o2 J0 F% l; }" q0 r6 ], |" A2 T& o - local str:string;
6 h9 D& [9 h: j" v - str := "I'm OK!";2 {* I/ W3 |4 B1 u5 N( }# z
- str := callLibrary(j,"resetStr",str);/ @& e- c6 _$ F1 R9 b" y, ^
- promptmessage(str);7 Q. S. \9 e$ _/ J) V; Y. B
- - @% _0 O7 a( N* a8 S5 [" R8 T
- callLibrary(j, "listAccess", Tablefile);8 f# O$ n/ @, E6 f" N: S
-
% r0 V2 R$ K3 g) ~! d - print "Unloading: ", freeLibrary(j);
1 H5 j/ n$ C; C$ M0 P5 ?* k/ d - end;
$ b, ~0 z) Q- w! `+ S; p4 s8 W - end;' ]4 R$ M1 z7 w: W* [7 ^# T
复制代码 |