- is' c! S% Q A b
- r:real; file:string;$ X: E# `9 r+ v- p7 N- S
- do
( A$ P( x; ]5 {' r6 S3 c- \, n - openConsole; X( a- O) s9 \9 m, g+ w
- / r/ k; M+ Y2 |
- /*
! ]* @9 i- V$ P8 {0 N& O7 h+ U- { - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
. R: p8 s. d5 ~5 @! x - when is64BitApplication then 64 else 32,' X+ ^* _$ Y) k$ L2 \! n' S5 C8 l
- "bit.dll");, Q7 w) K# U0 v* D( i2 I" ~
- */
7 x# u8 @% B$ l9 o( W1 T - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";/ q. b5 \. Z- d2 Y1 m; f& i) I
- local j := loadLibrary(file);
: b7 w) h' {' k - 3 T- r1 H) n3 T* ~
- if j > 0 then
0 c0 W' G+ G* f8 u( j - print getLoadedLibrary(j)," is loaded.";" C& e$ s' S( V! P
- 4 i/ e% c! `) w' U
- r := callLibrary(j, "calcSin", PI/6);$ v0 S" `! k* A* K4 f
- promptmessage(to_str("sin(PI/6) = ", r));
' x% W4 G" ]* k - 0 ~, y, X& [: G `1 E! x) \+ h5 _
- local str:string;" V! W' H& Y% ?0 {0 R y' f
- str := "I'm OK!";
, g7 d: C3 O% n( m - str := callLibrary(j,"resetStr",str);
, P( l5 r* B# j0 q7 t& j5 C1 m - promptmessage(str);
5 T, f) x0 _! L' K8 E -
0 U/ Q9 ]3 g# ^, A! e - callLibrary(j, "listAccess", Tablefile);
i9 }8 Q7 u) u" h( T# F -
6 H# W+ _& ~9 a- q% W3 ]( Q - print "Unloading: ", freeLibrary(j);5 c* m5 S) G. U0 G( c
- end;
; p9 `+ @: E& z' c - end;
* ~0 E0 L8 B/ R3 `+ p
复制代码 |