- is
, B5 q$ l6 _' o. e - r:real; file:string;4 {! `% m6 @" f1 l9 w
- do
0 Y+ N; _0 b& f o1 z' p - openConsole;
" N& U/ e2 p: r' @2 C1 L; s, b - & A$ w \' s$ H9 Q4 x
- /*
' F3 @. l+ E" R9 ^$ U3 A9 o - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
( e( T; _2 j0 g8 I1 } - when is64BitApplication then 64 else 32,
+ p1 l% O7 |& U3 \- o - "bit.dll");
7 r2 x6 \0 y8 D" o; ^' x( C - */
?7 J0 H0 Y* I l - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
( A- `# q; O; v! v- m8 N - local j := loadLibrary(file);- \# c* n" f+ d9 a* l8 y% Y
- F* O' l( {, p" h8 F1 N
- if j > 0 then
3 Z1 r) N$ K' w& d9 Y1 a - print getLoadedLibrary(j)," is loaded.";
- e2 z6 z7 m+ d/ y6 l: t - ' w/ A, ~/ o" g% M" C2 s& f
- r := callLibrary(j, "calcSin", PI/6);0 P* Y% _2 J( S# I5 }9 s) N' b
- promptmessage(to_str("sin(PI/6) = ", r));$ e/ u( G, C/ @ {0 r2 x; O
-
- t, m4 _5 ]& E4 U, k8 g$ x - local str:string;
% R. O% C% c3 `7 }( i3 F1 { - str := "I'm OK!";. c- e# O6 f! H
- str := callLibrary(j,"resetStr",str);
|' z+ ]2 G% D! ]3 M - promptmessage(str);; J+ F- J3 R' V. N5 K. D
- # v6 U& W4 O; H3 ?& w4 S
- callLibrary(j, "listAccess", Tablefile);! K J3 c2 C* e8 x3 l
- 2 B! I4 x7 g4 S, B) Z6 y! c
- print "Unloading: ", freeLibrary(j);
+ D: i5 G% I B: ] - end;' F* Q. e5 R- p' K6 \# a
- end;2 S2 P7 N0 C7 S8 R5 R
复制代码 |