- is
; ^# r$ d1 t0 O8 P. o( `8 g - r:real; file:string;
7 C/ w3 q% X, L7 ~1 C - do
* S2 t( E/ ]0 b1 \% S" v$ `8 G - openConsole;
9 {1 V+ }0 `# z/ k. o
0 s; ]( p- g( _- /*
/ w# Q: ?; K# D6 V7 H: L - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf", C9 m+ W" _1 G Q, W% D
- when is64BitApplication then 64 else 32,
8 I0 v! z% S) x/ Q6 ]0 f" I - "bit.dll"); H V" y7 g, x! r% \) b$ D
- */
- g$ y: ^& j) n! Y7 l7 g" ? - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";; S4 k+ ^6 C6 m7 u9 }
- local j := loadLibrary(file);9 @) E# y! l4 X/ A: B3 }
2 m6 l+ }9 c6 `9 L/ R) d4 R/ t4 X1 b- if j > 0 then
: s& r C* F5 w. i3 N: ~+ P - print getLoadedLibrary(j)," is loaded.";
' b6 J/ N4 p! G% e8 }. |
% Y! ?9 T! d6 `/ }9 p3 S8 ~- r := callLibrary(j, "calcSin", PI/6);! w3 m" `: D; G9 V
- promptmessage(to_str("sin(PI/6) = ", r));. V* g, {9 h& y+ L. H m9 a9 ]
- $ x( k$ }% ^! g
- local str:string;
: q$ c6 P- |: x+ d- h - str := "I'm OK!";2 q: t/ _# X @* y
- str := callLibrary(j,"resetStr",str);
, q6 ? R% `; G, R3 J$ o; O, } - promptmessage(str); A! L5 b9 N8 a4 f
- . V2 c5 f( H+ G# n$ Q+ S* C$ Z
- callLibrary(j, "listAccess", Tablefile);1 @/ _/ b: b$ K1 r) f P6 D; C6 F y
-
/ ]0 D5 A7 t& g4 H% V - print "Unloading: ", freeLibrary(j);- ^& s' }7 s) d
- end;
" @/ `9 M! n5 y) w3 p! l/ `# P8 X - end;1 X5 O/ J6 n4 d, O
复制代码 |