- is. V) A* e* s) x! T1 {
- r:real; file:string;
/ Z6 B0 [$ b- ]0 r( d - do3 B6 r" v- B! u2 g2 ?$ C! |7 Y
- openConsole;
3 a1 U( d# i' l$ t* G
1 o* H: d! k5 q2 N( Y: \* p- /*
$ `0 P7 u1 j# I. u/ P1 i+ ?& l; ?# D - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",8 e& f8 `8 k9 ?. [6 G
- when is64BitApplication then 64 else 32,# ^6 S* o) r5 E$ p3 Y
- "bit.dll");* P5 H X2 y. u9 }
- */
+ L: r2 G( `, o5 l# M) {9 R - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";1 ~ ~) R" `/ i d" j) `# E2 ~
- local j := loadLibrary(file);
2 x; F w+ N2 F5 h+ d( c: x - ( o( V0 R) k( w4 e! N
- if j > 0 then
- e2 H- w5 v E, K, } K - print getLoadedLibrary(j)," is loaded.";
) X# M" s" d) X
5 ]( e3 X2 r& N6 x& d, s- T+ G- r := callLibrary(j, "calcSin", PI/6);
- _4 H( Q4 u( p - promptmessage(to_str("sin(PI/6) = ", r));
3 [ @" {% k( J4 A8 D/ M$ h - + r8 e& A# r( b; S: ?) t
- local str:string;
6 C* D7 ]& i5 v+ K3 B- K - str := "I'm OK!";( `- v# A. ^2 s% h6 d
- str := callLibrary(j,"resetStr",str);3 M! M2 E/ u, [. ^" H7 b2 W
- promptmessage(str);
9 z! k3 K) ~: v; X# n - 7 s) E4 R5 J" P, t$ {/ b( T2 w
- callLibrary(j, "listAccess", Tablefile);# V3 _: B, Q8 n
-
0 P! k" |! w% O/ I ^ - print "Unloading: ", freeLibrary(j);/ W1 ]/ v: ~6 k7 E
- end;
& {3 d9 c: D- V - end;
% O$ t! f6 _0 b- U0 g
复制代码 |