- is8 v, p& m3 l) i+ @
- r:real; file:string;2 _ W6 m; J- P& x$ ^0 C! C) t
- do
3 R2 m) n& K0 K7 m" c k1 j+ c8 d - openConsole;
) i8 a0 E" b1 K - 6 x9 L. O5 a6 s$ r/ s) s$ T% o
- /*
7 F, z( I2 b ] s - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
+ i' z& u8 ~! q M1 s - when is64BitApplication then 64 else 32,
+ v: n1 \3 }5 j# r6 T) o - "bit.dll");% j+ i. c; Q0 L
- */
) V5 D8 \& P0 j - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
: N7 _- @% v e! y/ F - local j := loadLibrary(file);
. N2 V+ Q# M" D& N0 S! r9 T
0 u4 j" S' a( q% Y4 [- if j > 0 then
& W4 s' E& |6 x4 |5 v - print getLoadedLibrary(j)," is loaded.";) C( [5 Q( i; V- u: v6 C
. I' P* c1 s- V% x% [/ `7 ]- r := callLibrary(j, "calcSin", PI/6);
4 R8 v# I4 E: P" v - promptmessage(to_str("sin(PI/6) = ", r));/ S2 Y$ e$ ?$ Q9 k, R7 F I7 ?) D
- ; p; ^) P( ~" X+ l+ z# G# E- T: K
- local str:string;
% z1 }" l9 `9 H2 J I: B - str := "I'm OK!";5 ?7 ?: ]2 L: L! k: c' @
- str := callLibrary(j,"resetStr",str);! W( B+ g* B, G/ j7 }8 e
- promptmessage(str);
7 l6 G! Q6 E) f5 l+ U: H' ~ -
! g# v8 n2 L" y( e$ X2 j - callLibrary(j, "listAccess", Tablefile);% L! } c4 t/ w4 P7 ]; c8 X _# b
- 2 J1 D6 P* o/ M1 u3 u+ ]& z) y. @, \
- print "Unloading: ", freeLibrary(j);
4 f3 c% g0 L! `2 k1 w ?! i- d0 q - end;9 Y0 K, }3 P1 Y2 W6 x4 c
- end;
; K( N; B: G' z# j4 ~
复制代码 |