- is# O6 y# F. k. `
- r:real; file:string;) o/ h3 ^9 x+ j% F9 y# ~7 v9 Z
- do
* ?5 B9 |5 r! R1 n3 [0 J7 l- i6 G - openConsole;- v; K. \' T- k
- / R6 a3 _6 {9 N7 S% F% u
- /*
3 A! I3 F8 w1 ?: Y - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
: p) C4 y/ s' D: r2 _ - when is64BitApplication then 64 else 32,
) _# V% W* q8 B9 W - "bit.dll");9 f, a& @* n, Z6 E. Z, ^5 k3 ~, |
- */# e" R& ]8 U, T; w6 ^; h& Z- c
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
) i- a4 ~& V) X - local j := loadLibrary(file);3 ]0 `1 E6 W6 Q" ^) X4 ^
0 e+ i: H# F9 u) T, n& Z# x- if j > 0 then
/ n$ u$ V5 T4 O; Y! ]+ b7 K2 b" x - print getLoadedLibrary(j)," is loaded.";+ C+ q+ W+ l5 v- w& Q7 P6 n# X: p4 C
* {, C" `2 A5 z$ m: d6 j0 u. O- r := callLibrary(j, "calcSin", PI/6);' T; N8 c( H5 y4 c- v v
- promptmessage(to_str("sin(PI/6) = ", r));
. a/ ?5 q. @9 R9 H -
7 `3 I+ l+ [, o, B0 |# ]$ L% {8 Y - local str:string;
1 N5 W) l) f, I$ M) { - str := "I'm OK!";
5 e, S; n5 V/ M6 |% ?$ t - str := callLibrary(j,"resetStr",str);
+ q, t) ?8 j3 ?6 i e% I - promptmessage(str);
# ], J$ h5 t J. p% j9 h1 e -
& X/ |/ R- B5 v' a. A8 a) B - callLibrary(j, "listAccess", Tablefile);
0 p8 V# |' ]& y" j; c% X% D - 0 a2 \& z) j6 Q w- X l7 a$ y9 k
- print "Unloading: ", freeLibrary(j);
' d. w: k" H9 d& C: o - end;, Y+ v7 e& C+ u' a9 a6 F
- end;! C- y5 K9 F) G! m- E2 ^8 H) r
复制代码 |