- is
- q/ R1 ]: E2 n h2 f q - r:real; file:string;
& F$ F1 z* _' t" M4 I$ V - do
- ]' |& \1 c: _9 g _; B9 S' D - openConsole;
0 @+ b* K( j0 Z( k9 F8 N. Z
$ d2 [5 ~% D' Z5 u- /*1 ]6 U: a- H9 W' g
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",, `! T0 }9 x; W
- when is64BitApplication then 64 else 32,# A( Y: r" K, A) u. b
- "bit.dll");
! a* D" N X: O; P! z4 k - */
* }; d) ?: ^% G - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
! L- q9 l! r! c J8 s& N - local j := loadLibrary(file); {1 M* j( V" G E
- 0 @! |& l7 p Q! v4 V
- if j > 0 then* b( t& T$ ~3 B' a- x0 z, m. [: J9 R
- print getLoadedLibrary(j)," is loaded.";
+ _+ f2 v# T; z
% d1 O6 o! x8 p1 a7 C" \, p- r := callLibrary(j, "calcSin", PI/6);
) H" R/ [0 q# T' ] - promptmessage(to_str("sin(PI/6) = ", r));8 D* }; S+ F$ H- ]3 e4 b& M
-
/ U) Y7 Q$ W- Q/ l T, L' f - local str:string;
- A4 T# K% r6 I; c! u$ ~ - str := "I'm OK!";
6 l$ ^. }# H$ @6 H, Q4 l6 p0 \ - str := callLibrary(j,"resetStr",str);/ U* }6 j) ?+ r) F1 k
- promptmessage(str);& M! }3 u6 Y( W0 @; Z0 q: O5 D
-
r( _6 X) ~7 S" L' g - callLibrary(j, "listAccess", Tablefile);
4 Z* h, O* p9 D. @; C: U -
$ Z% I; \8 C; O0 s8 ~$ _ - print "Unloading: ", freeLibrary(j);) q B, p7 B; d5 T% f2 u1 n& N
- end;
, ~4 W$ F: i/ R! @; G - end;% F3 }' D2 ~7 r, D& o H) k9 M
复制代码 |