- is
2 w. E+ d3 G* w J- N4 r [+ C - r:real; file:string;$ S6 Y! J' k1 X- y; \1 C
- do
2 L u" Q: I+ x* F1 ` - openConsole;* H; n( g* I. a7 f
- , H! K4 ?0 i. k) s+ j& A
- /*4 b. w" Z( f" [/ @! {. @
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
0 F+ m3 }+ X& o - when is64BitApplication then 64 else 32,4 ]5 x$ u3 h, C
- "bit.dll");
: O2 U# b2 S; m3 R7 Q1 r - */0 u% O/ S( \/ K9 D% c
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";, r& }5 z& d I4 Y
- local j := loadLibrary(file);
) \9 q0 I' r- N( ^* d
& D; A0 Z8 f& \/ l& O( @- if j > 0 then
+ o1 x9 U6 `& D+ [& j! f - print getLoadedLibrary(j)," is loaded.";
4 }2 k! q6 G) s' X5 H5 c
. Q* o5 n+ @& F) ^- r := callLibrary(j, "calcSin", PI/6);1 @% v8 B# F% H3 I! M: k5 p
- promptmessage(to_str("sin(PI/6) = ", r));
4 @3 l+ y7 @" p/ ~" ] -
4 b% e, a3 t8 C! L4 k - local str:string;
# E* L9 J3 _- S) f" T- u, k - str := "I'm OK!";
* b: R2 q5 Y& p' Q5 `+ ?6 D) I - str := callLibrary(j,"resetStr",str);
( }3 X2 y/ Y1 t6 M: G - promptmessage(str);
4 |( c- c) L$ L$ R! N4 s4 I - 1 C2 h/ `: \6 [1 Z
- callLibrary(j, "listAccess", Tablefile);$ a- U, c2 e& s4 d
- 5 m5 x! \$ o3 R W9 N
- print "Unloading: ", freeLibrary(j);
( z$ h& H$ n0 M# w5 t: q* G- h - end;
* w, Q& Y: a, X- W2 o( m; q - end;
6 @; \* j( i0 A$ O X6 z. \
复制代码 |