- is/ }7 B% F4 Z5 |! {: L+ F z: N
- r:real; file:string;* Z$ N2 P8 L4 c9 X3 L" o0 m
- do
. X! T6 X3 X7 M$ [ - openConsole;1 F1 e: I) D+ u4 L- u
3 a2 N7 H2 _2 Z- /*
- b( J O+ s" M$ G) ]/ K% Z! C - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
5 @; w! d2 x# \# c. y: z, b1 \ - when is64BitApplication then 64 else 32,
0 ^+ J1 \" m/ D, {* Z# B - "bit.dll");
% w6 u9 Z+ z. r: t0 H. v - */) j5 \' t" p% ^
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";, Q& L9 o, Y( ]( V
- local j := loadLibrary(file);
3 R y5 z2 ?; Q( k9 z - / @. e, M1 a2 b# L) y' Q
- if j > 0 then# a; j1 k# j4 ^2 T% `, _, _- N
- print getLoadedLibrary(j)," is loaded.";
) ?* K. N1 ]( ^! j% N2 l h( A - * N% }% G. a! d' F: y' h% [' J4 d
- r := callLibrary(j, "calcSin", PI/6);; H8 Z& \& Y4 V0 I/ Z, v' `
- promptmessage(to_str("sin(PI/6) = ", r));
) K6 b- Y' o u- Z5 H( R -
$ s5 x7 B$ o V0 ?+ y: G) E - local str:string;
3 E* k1 L; J' h4 |( t - str := "I'm OK!";: T* t, T, s% q# j6 K3 R; ?
- str := callLibrary(j,"resetStr",str);
! m& X% P2 _5 \+ _" R% X0 k - promptmessage(str);" B, d/ V- @8 o) Z* J
- 4 ~0 a5 a: ?) m5 @! [/ O
- callLibrary(j, "listAccess", Tablefile);- j% A6 u" a4 C {. O3 d
-
J7 f+ {0 C, @. k6 u Y, w - print "Unloading: ", freeLibrary(j);$ }4 A' x% o: A. w
- end;) R C& U% j0 i6 j0 Q! y9 Y
- end;) w8 w: W" j* O: L/ r
复制代码 |