- is
* i6 [0 E! H/ G' r! q - r:real; file:string;
/ s3 W8 y% Z" S q& M - do. v% |; l9 ^7 c" w* l9 V6 E! j
- openConsole;) u/ {# E9 x" {/ ]
6 {" B% y& u z- O% V# z- /*( `6 S9 A3 r% Y3 T& m' C
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",/ D0 B% Q% }" I9 \
- when is64BitApplication then 64 else 32,
& ]# J( u; C& w8 G - "bit.dll");, U" k$ Y9 T' F3 u3 A$ H0 l2 W
- */
( A" s* }! @8 o* d5 v - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
( c- \6 Q/ i. y( T$ C6 b6 i, J" d* J - local j := loadLibrary(file);
7 W$ d- k+ ~7 u0 _: t - # x/ @% u; f$ h) }- C# @1 q, T& z
- if j > 0 then
: j+ |/ ?+ g( ^- ] - print getLoadedLibrary(j)," is loaded."; l5 `2 f6 y0 T3 d
! ]$ @$ ?" I: c, H! [- r := callLibrary(j, "calcSin", PI/6);% t. g% i- [" [& Y9 J; }& f
- promptmessage(to_str("sin(PI/6) = ", r));
2 @% \8 o4 L7 v3 b( }+ }& a -
! ?9 f: L0 Y5 i$ b5 E4 W& ] - local str:string;0 R7 _( @# J9 |
- str := "I'm OK!";" c6 W. Q/ ]9 k2 L
- str := callLibrary(j,"resetStr",str);
8 P2 c, L+ k* g, l" g - promptmessage(str);
- H4 A1 e2 R# U9 r - : p7 g: K* p6 I3 R9 z' f
- callLibrary(j, "listAccess", Tablefile);% Z/ y2 @& s5 d R
-
# V/ h+ B% z$ g j8 \ - print "Unloading: ", freeLibrary(j);& U' F, {+ i1 `, I4 I& K
- end;- x! X& S* [, G7 B$ N7 q7 D+ m
- end;
- k- A" f) C0 E: ~) d' v; s5 X! L* F# Y
复制代码 |