- is
* T; i; ~* L. S, |9 l - r:real; file:string;
5 n( v M& c# N" w+ w& E. C, h - do- Y. F$ y W+ e
- openConsole;8 {) ~2 c4 f# V9 _
2 E+ V* y1 m2 d8 E6 o. q- /*
" p) k0 V: _$ }- C - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
2 W- C% C; o! a* D, k - when is64BitApplication then 64 else 32,; l" W& c/ ^0 m/ Q4 `% R1 f
- "bit.dll");$ B4 t; i( O: [3 O. w
- */9 P+ Q7 u, j& @. \9 T$ u
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
- y8 A8 P9 i/ U# Y4 n, g6 v - local j := loadLibrary(file);0 q* I. F- H9 `
+ u+ P( y4 z. H, N- if j > 0 then
+ i# |2 l5 K: ?% T - print getLoadedLibrary(j)," is loaded.";- }/ r3 r1 V( h4 H3 z
- 8 G7 b4 E" L8 R" n
- r := callLibrary(j, "calcSin", PI/6);
F0 f* n7 h1 i1 ^" T - promptmessage(to_str("sin(PI/6) = ", r));
" O6 Y$ y; v2 N( D - , n- O+ A- t3 @0 t) Y
- local str:string;
8 ?4 ]. \- D/ f3 G! ^2 w - str := "I'm OK!";
n W2 F2 p! _; I5 m1 R" D% d - str := callLibrary(j,"resetStr",str);7 E4 N% L Q0 ^ X' `3 E
- promptmessage(str);
6 n, p; M( }5 a- ~3 ?9 l - , c2 i- k2 }. _
- callLibrary(j, "listAccess", Tablefile);9 d2 \. x$ J# H. T+ t& T
-
: E9 j- O% p( E7 D% [& G V - print "Unloading: ", freeLibrary(j);
# h) @9 {+ N b5 z u0 @ - end;: l0 W/ B7 f' `1 k
- end;
; Z/ q1 O6 s7 n0 B
复制代码 |