- is- g) D4 H; R8 E
- r:real; file:string;
, \+ b2 T+ v, t ]2 r - do% [; ]/ G0 |: o7 N$ Y
- openConsole;1 p8 F9 m0 H8 P( t* G. G
9 o( j$ ]0 e( p" z+ o9 k! f- /*
& b# ^/ t0 p% ?7 C! b$ Q9 A - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
9 l6 W7 r# g9 l. v* T8 Q/ d - when is64BitApplication then 64 else 32,, L+ g. j1 f4 S, R1 J0 f8 d
- "bit.dll"); I M" U5 z/ m/ d( Q
- */
. v% U0 N: ]# v) h' C& ~/ x - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";# E( O4 A4 K3 Z7 J; Z
- local j := loadLibrary(file);
0 [$ l& T. K+ q& v2 T6 S! [ - $ C1 G [+ [7 S% G: Q' A
- if j > 0 then
0 k2 x! \4 d9 U# f; _1 C - print getLoadedLibrary(j)," is loaded.";
* R7 s* X' U6 {% O9 a+ {! o2 h# I
/ B& ]2 T# k$ n. N- r := callLibrary(j, "calcSin", PI/6);
1 x4 {$ S. W! P' m4 |: l - promptmessage(to_str("sin(PI/6) = ", r));
6 Y( o/ y1 ^1 p9 z" V0 H -
: J. S1 O; E# W - local str:string;9 S# F" h& p/ f
- str := "I'm OK!";
4 B, ]1 v# q5 r: {# D @ - str := callLibrary(j,"resetStr",str);
8 [8 M* Z5 _: |6 a% ~ - promptmessage(str);
2 x- X1 V; T" V! V2 g6 J% `0 o: o& A - 6 n& a1 \: C/ o: p. M
- callLibrary(j, "listAccess", Tablefile);# U+ W3 L- ]$ H0 X0 _! W$ M
-
3 D/ |: d1 q% l- y3 U& P - print "Unloading: ", freeLibrary(j);; C% n" n. |" F' g
- end;+ l* O9 c8 N0 y7 b: }9 E
- end;0 ~, f9 R$ d. q! N) T
复制代码 |