- is& V1 q9 N$ v6 m) u6 S" i! E) }
- r:real; file:string;1 }- A0 U$ K2 ?" h6 M2 f8 ^% g
- do
7 i: l6 E' F6 E0 S* C+ s - openConsole;# J0 F# ? w! g6 B9 f0 G+ s
- $ Q# x1 W5 U/ n
- /*
" M( a. t& R6 O- X: {& C - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
! Z6 M0 u5 g' w3 X3 i; Z6 C2 R: c$ @ - when is64BitApplication then 64 else 32,
) v6 l9 s; Q3 o, ? - "bit.dll");2 V4 ^8 D" v S, Z5 W
- */
9 _2 Q/ h3 j) d7 z - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";+ i! |. ]- j3 h& w1 K
- local j := loadLibrary(file);
7 ~$ y7 G* A: F( _; p0 U - 3 S& e7 N- z' F
- if j > 0 then3 Z S: _& n" ^' c; B
- print getLoadedLibrary(j)," is loaded.";
' t. Q# [% r4 |& v
7 y/ j+ F* h3 b- M8 E- r := callLibrary(j, "calcSin", PI/6);
' {( p% H$ Z, e% f - promptmessage(to_str("sin(PI/6) = ", r));' o6 C3 K% f R! m% P5 F+ L
-
C" [2 w9 p: b) L* ]( b% N - local str:string;/ {9 P. O% O" ?/ O P
- str := "I'm OK!";: `/ U* E, W& Q5 {7 b
- str := callLibrary(j,"resetStr",str);
) ?- T3 D' J3 e% g6 M - promptmessage(str);3 L# X( Q, m- p0 D
- ' l: F; \, \) `4 A
- callLibrary(j, "listAccess", Tablefile);
2 M# x! B# V0 d1 Z, t3 A -
. k4 a+ h* x/ q% e$ H0 X - print "Unloading: ", freeLibrary(j);
. ]0 v$ i# a- c - end;
. Q! l8 S3 R& L% s - end;, p0 `4 r$ f7 x
复制代码 |