- is
b9 `3 c# I" r. N$ h- E - r:real; file:string;& l l1 P! |6 S2 \' H8 D4 [4 C: L
- do! b: [4 e* Q+ w+ Y; {% r8 I, G
- openConsole;
1 ]0 W7 O- M& [2 O2 Z - * j& c& R9 e6 U% d
- /*8 t: J% k8 F0 s9 A
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
9 |1 F1 U. h. J2 T+ E2 f - when is64BitApplication then 64 else 32,
( O% ~7 d. q: @; |! w7 {! v - "bit.dll");
4 y: {/ R/ ~6 l6 @+ _0 x - */2 {2 D1 o @5 S$ |; W7 J" u
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";/ h7 W; @. y, {) r% y
- local j := loadLibrary(file);
4 G) p) M0 V# j& t* X* I
1 k: ?2 [7 \& j) M% |& G# c- if j > 0 then4 B5 Q" v3 O& Q) T
- print getLoadedLibrary(j)," is loaded.";: i- t% D! I3 t7 P. T% ]' e, c: S& f
- 6 z' h7 s& C, ~1 y) o) |; D. J
- r := callLibrary(j, "calcSin", PI/6);
) s9 ]6 r1 Y( n7 q6 @ - promptmessage(to_str("sin(PI/6) = ", r));9 h- r! A1 C r! R0 O5 n* D
- # a; h" j' u, [: m( W) u8 U a: G
- local str:string;
: H& D3 _7 G8 b0 |) R8 B - str := "I'm OK!";2 [) Z2 o' K r) W3 | m
- str := callLibrary(j,"resetStr",str);" A$ |0 g) @/ T) J$ B! w
- promptmessage(str);
R* H! L }; m* s& f! G# |- @ -
# h+ }& X; V: ? - callLibrary(j, "listAccess", Tablefile);
" r% W4 G1 q0 y0 Z) L* a -
0 z W8 k, K. h' L - print "Unloading: ", freeLibrary(j);# s0 n7 K5 ~3 j: m" I* Q
- end;
. G3 R0 G: {/ m/ Q* p - end;- j$ n2 D+ K' I; a/ B
复制代码 |