- is
7 `: J. q5 P7 [1 }" _3 E* c - r:real; file:string;
% G+ v. B* C0 z$ t# s8 t9 E+ p: R - do* \7 l/ j! z" P9 c7 e) K; e
- openConsole;
) o) [* c% E- S2 ^% I5 X
" s% Z7 c/ I" p0 i* w- /*
7 r. g0 W# B ]. H. q- z5 H3 @ - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",% S" S/ U+ L5 |# z
- when is64BitApplication then 64 else 32,
0 T b. n! m3 X( V1 I+ m: \ - "bit.dll");+ Q3 p. _" v* _! V. q4 M8 v- N
- */ X$ ~* X ]1 V5 O0 T
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
& @$ i4 L" C M W+ T; F - local j := loadLibrary(file);
* J' \8 x1 m, w) H7 } - T; i' w3 B0 C! U
- if j > 0 then
( W+ d- X5 p \1 d/ u- B6 c - print getLoadedLibrary(j)," is loaded.";
8 k9 D/ p9 W# U4 a8 n - $ c6 B3 T' L2 \9 J M) }7 z
- r := callLibrary(j, "calcSin", PI/6);- U5 ?& B0 Z. z/ p
- promptmessage(to_str("sin(PI/6) = ", r));3 W: Y- b, K8 J6 a$ g
- , ~, u2 c' I- x! A' \
- local str:string;! L( g, A9 O$ K
- str := "I'm OK!";* C# z/ R6 B1 x1 `" G2 o& F
- str := callLibrary(j,"resetStr",str);. n7 \) y' k" a* w2 Z/ k3 S9 k- J
- promptmessage(str);4 ]7 W+ r: L9 k* [+ G
-
2 N7 W+ |5 k( J) o' o: o8 s - callLibrary(j, "listAccess", Tablefile);7 z; C0 U9 Q L( Y+ `' m5 ?
- ; a1 |" ?; N. j6 t
- print "Unloading: ", freeLibrary(j);+ f, h1 C" t- B- J+ u
- end;
9 N: s0 h6 ^7 F& i+ R - end;' P1 k+ g) [( O6 X/ I% v
复制代码 |