- is, Y* F; C" _6 w
- r:real; file:string;
' h }: W$ ^- a0 H6 V) }: e/ }% r - do
' ^2 X7 C/ K3 u" a0 i( x! ^" @ - openConsole;
6 }7 s" `9 a1 N# C - 4 w0 [% r, {, b5 j. ~
- /*
9 T" Q: z8 g( E - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",7 T P9 \2 z$ a
- when is64BitApplication then 64 else 32,
v+ x, R U2 _( R - "bit.dll");
: x4 D( I, B) |7 C- A - */
6 Z: M/ U; T6 c( t - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";3 j% V0 P- R% Z% b" L8 \/ x2 w6 W
- local j := loadLibrary(file);
1 h w: C- i7 z: f" Q
Z7 M% V, Q" l5 g- if j > 0 then
+ i* a0 `+ V+ D9 X' X/ D - print getLoadedLibrary(j)," is loaded.";' B+ b& [5 |$ h( T8 R% G4 L
- : P' w/ \" l q( @6 z4 V
- r := callLibrary(j, "calcSin", PI/6);5 q p1 @3 v9 L1 S# N
- promptmessage(to_str("sin(PI/6) = ", r));# A A8 x0 D3 Q6 }3 d5 _) g
- N- v* ~2 }( s! H' m
- local str:string;/ }' {7 l6 _" h6 H, h/ L
- str := "I'm OK!";$ k8 a E7 Y- t& l" V$ E- U* K
- str := callLibrary(j,"resetStr",str);* \* q+ _! a- U( ]/ M4 V, C
- promptmessage(str);
4 A! o! s9 U* S2 g& m j -
' f0 G& T. D7 m - callLibrary(j, "listAccess", Tablefile);" `" O* R- L0 i7 K: |8 h% C2 n
- 3 E% E8 ?' w3 H! l0 l' r$ O
- print "Unloading: ", freeLibrary(j);
% `+ ?+ q: o- w; t" ^; V7 i+ }, T( z- J" g - end;, x$ O' k% X s: q' \; t& N F
- end;* ?" |6 E+ J, ?$ e
复制代码 |