- is
. k1 M8 h' d! m e/ c - r:real; file:string;
' X* `' |5 u6 Y, J& _ q - do
* H2 t4 v: K( F3 A - openConsole;* U( m; I& Y4 V* f
/ s S- Z9 C9 Z9 |1 U; N9 F& o6 A- /*
2 V; V6 R1 I: X9 W. o M9 n - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
+ Q# p* ^% M; w9 f) J - when is64BitApplication then 64 else 32,0 }1 a) V+ u) Y3 l" |3 p
- "bit.dll");: C: N( V6 }$ \: m" l
- */
& w; d1 q# X# b1 D* P - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
1 @2 y- F h2 a; V: T% ] - local j := loadLibrary(file);
5 V4 ^ w4 o/ [0 c& ?* b" s
) e+ Z1 |9 l( q- if j > 0 then
/ |" H8 B! V5 A: W2 g; a - print getLoadedLibrary(j)," is loaded.";
! i) D1 j" r5 q! o3 \' S( J7 S
6 C* o! o. U, u _# X6 M& V- r := callLibrary(j, "calcSin", PI/6);
) O3 v# {4 Y, S$ W( `( J3 L - promptmessage(to_str("sin(PI/6) = ", r));8 f5 w: m% G' }2 ^0 u
- ) [# r1 d7 p$ g
- local str:string;$ ]+ i: V- p& ?. ]8 y
- str := "I'm OK!";
5 n( i% A8 E9 r; J! \, d2 I - str := callLibrary(j,"resetStr",str);8 m; h4 I: R9 O) B& M) T
- promptmessage(str);
7 u% L# w# m% G4 C7 ~ -
9 L6 ^ A; w* S+ }4 r Q - callLibrary(j, "listAccess", Tablefile);
) N9 G! G$ h% ]- q* t. h7 c -
0 x$ X3 w) a5 J$ | - print "Unloading: ", freeLibrary(j);' s3 y4 o, `# z8 m8 w, ~
- end;
. `6 F( }6 P$ T; n8 [ - end;
9 }- Q. |. P+ i
复制代码 |