- is
! F* Z. P( T ~" @8 s' r - r:real; file:string;" R4 W2 e8 y: ?! s4 W$ ?
- do
; a* e0 J) e+ U. X - openConsole;
# }* h) z5 p0 |& x9 r$ U% \6 B - 0 U* i2 `. \- g+ r
- /*
9 @# Y+ ?4 D2 M4 h0 @ - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",7 t6 y$ d, X/ P. C8 [
- when is64BitApplication then 64 else 32,6 U0 \ |4 `0 f! o
- "bit.dll");+ K* n: p5 `' Y5 \/ Z* b) y1 w% v
- */$ n; e- d+ h5 C) K
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";* c& K! a. K/ O
- local j := loadLibrary(file);# h* q3 f: E2 d) `# n; A% B$ L7 a
- 6 p( ^" c3 o `8 V! {2 E/ Q! X+ a+ U
- if j > 0 then
; f# t% w" c' U2 D; Z* } - print getLoadedLibrary(j)," is loaded.";( c1 t l. w( u" X1 ?2 v: b
- + Z- j* M9 Z0 T
- r := callLibrary(j, "calcSin", PI/6);
- s. I! o% o8 A, B$ y5 @ - promptmessage(to_str("sin(PI/6) = ", r));
' T0 M$ E6 o6 N7 ? - 2 L/ A6 i' H/ m* l
- local str:string;9 p( o, t. A R" y$ Q
- str := "I'm OK!";
9 {, t ^/ u1 G0 h. w+ a - str := callLibrary(j,"resetStr",str);
! A0 F$ Z5 \8 M$ d - promptmessage(str);* q" @' ^ z/ F# {( O# {9 E$ K
- 1 D. v h, ~( r2 I1 V! L! v4 [
- callLibrary(j, "listAccess", Tablefile);6 |' v# L+ _ W. V6 p
-
* U% G- j: u+ E* R* [% d1 N - print "Unloading: ", freeLibrary(j);
" P8 K9 k; f3 o$ V. e7 i8 w0 c' c - end;, |: k7 s3 O: ^1 h8 i2 o% D
- end;* t. R; w. A3 V/ V7 v+ r
复制代码 |