- is/ M, G, b8 f9 k* i( Z
- r:real; file:string;1 R$ b( k0 @ l3 ?3 O
- do$ B4 _# W. c2 f4 Z3 r/ a8 T
- openConsole;* I' u+ ^* W* Y/ l$ {* L: w9 @
- 9 _ }& Z* D8 T% h
- /*
' ?8 X/ x& V$ F6 b5 T) s0 Y& H! H) D - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
+ n8 e% U h6 U9 w+ l - when is64BitApplication then 64 else 32, M2 J$ ~3 J% ?: r' A
- "bit.dll");$ W5 ]7 Q, C: L. B; i$ o' u0 |
- */% Q H9 z1 o+ J0 J
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
' {7 ^' a; a: S$ x5 V, M - local j := loadLibrary(file);
# }' Z% _# e/ I1 G9 c - ; Y7 u7 o! k5 ~: \2 l& }, _1 c4 K
- if j > 0 then& q. b/ N% z( W! c0 E" T1 e
- print getLoadedLibrary(j)," is loaded.";
1 y9 u( E9 R7 }; v - " X7 V! Z! c$ w; H: Z; r. p
- r := callLibrary(j, "calcSin", PI/6);
% t$ J5 U/ J6 M2 V$ K6 x- k4 {7 a - promptmessage(to_str("sin(PI/6) = ", r));1 Q( b& E# d% _, m% m5 i. o
-
3 |* d2 @0 h/ U& k# `4 T - local str:string;
+ }- U5 l# u! j# M3 ? - str := "I'm OK!";) p8 n$ ]) P" N
- str := callLibrary(j,"resetStr",str);: O. ?- d: u3 {$ d
- promptmessage(str);, j+ J q0 s+ ~: J z
-
3 m" P, o7 c. A7 [1 \# J - callLibrary(j, "listAccess", Tablefile);
f4 h. M* a* z4 W9 V) e - 0 o/ c0 P3 p4 p: I
- print "Unloading: ", freeLibrary(j);
; s+ u% U# n# {& U - end;: x m" i B; _3 o4 a2 H5 q
- end;
( w1 e' d1 s6 `; ~
复制代码 |