- is
' K) t* p' R+ g7 n1 p - r:real; file:string;
6 _$ X: W# Z; w' C3 M - do; I7 `# w" @# D
- openConsole;
- Y1 ~* o( N" h, y4 x8 a: p
. Z/ T C1 M! w6 [* H- /*
8 l1 F* d+ t/ Z* l7 z, o - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",, o6 P0 E2 V( }5 L) \
- when is64BitApplication then 64 else 32,
1 F5 n' p% X. V - "bit.dll");7 V* c2 ?2 o6 h% ]: J/ W* ]
- */' \' z; a% X( b( Z$ I% F$ h% S
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";/ g* {$ D* j& B0 i5 O
- local j := loadLibrary(file);. O) M3 G0 F9 K* N) W, j: d
( s @) F1 t, r }% ~/ w- if j > 0 then
1 g* {0 c3 _/ l% e% b - print getLoadedLibrary(j)," is loaded.";
& ?# ]. Q' Y* b# u. i, o - ( z( `4 ^. \! v, R3 K' v# ~
- r := callLibrary(j, "calcSin", PI/6);2 ^3 F" T0 |) _9 T) @- |
- promptmessage(to_str("sin(PI/6) = ", r));
" L7 H# S& q# W7 v' H# `6 E - % x! r+ i5 S0 a! O/ X
- local str:string;
$ P' N0 r: S9 F5 F0 w8 w D - str := "I'm OK!";
" l7 b! B0 b. i4 o/ _ - str := callLibrary(j,"resetStr",str);
# k3 {; Y" Y* S [1 l/ W - promptmessage(str);
& ]4 k4 H% Y* t% b# @% y/ N -
0 x* ?6 C/ A$ [: F1 ~ - callLibrary(j, "listAccess", Tablefile); N1 z3 n6 Y0 P- E$ o( d2 ]
-
1 D7 L9 }: g, a, ~+ ]" i- m$ H5 [; { - print "Unloading: ", freeLibrary(j);4 w4 `3 L1 a, e$ o" Z
- end;
) {1 r/ L: Z$ j - end;$ Y& d# z' y" d, Q" p1 k+ _. S6 K
复制代码 |