- is
6 o' | K f* a Z( X' Y' ? - r:real; file:string;
" H+ w3 `# F+ e0 [0 U - do
) R: Z! X/ T! \# q! K& L - openConsole;
* I2 G. M0 @4 I, A, D, G ?5 ?' _ - 8 x# q, u9 p- k0 j3 A
- /*
. l) k, e! H9 O% | - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",3 r5 H- e2 V p) f7 Z
- when is64BitApplication then 64 else 32,; c7 Q) O |7 c3 t6 R; X. d3 h9 }
- "bit.dll");
1 }+ Z1 b8 |* t- ?6 D$ r - */) g0 C/ Q: _) {: D( P+ h* b y
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";" ]3 e* b1 n; g* H7 V
- local j := loadLibrary(file);6 {2 @/ ^8 J& t" M5 D9 }( a4 Q
- ( u4 W. Q7 {$ L8 A6 _) V2 ~
- if j > 0 then, [0 `: m3 N- x- t: }0 |# L$ z
- print getLoadedLibrary(j)," is loaded.";+ H5 Z5 X; J3 b, ~
- % ]; G/ {+ B' A- v, p5 i
- r := callLibrary(j, "calcSin", PI/6);( [; ^* _7 r$ h8 J( O n
- promptmessage(to_str("sin(PI/6) = ", r));
' y0 l) F: i F -
% ?! m, m1 d' \& e - local str:string;5 ?# c+ B X6 G9 @' t1 s: E
- str := "I'm OK!";
+ N7 T6 q' U9 p" F, A8 | - str := callLibrary(j,"resetStr",str);
^ h4 s8 e: A. i5 j/ m/ o - promptmessage(str);
+ Q0 A9 ]! P g - 9 g5 z) [8 [0 e k
- callLibrary(j, "listAccess", Tablefile);
/ E; a' }# ~' r" v -
0 B1 |8 D" N2 J - print "Unloading: ", freeLibrary(j);
1 {/ S# K; w: _$ U2 u - end;
) N4 [# Z: l! h" ^$ p4 O# w - end;
: K% U3 {) r. c! e+ q
复制代码 |