- is: ~2 u/ U- v+ I6 v: }, z% Y
- r:real; file:string;
2 V: ?8 B" P4 u9 `* h( L - do8 |- u _3 m" o6 H7 P
- openConsole;, G, e# n5 P( y9 x) B
& P4 }0 d/ M) w8 k `- N1 m- /** J& }, s. f6 M V! e
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
- W2 Y4 p3 e2 m6 G - when is64BitApplication then 64 else 32,
6 M+ |( U8 ]- c; m1 z - "bit.dll");% [& _6 ?4 p B- q3 O6 t
- */% _$ g5 \) c2 x* D6 f. i4 ]
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";) U& A& W7 p. G. u% @! P
- local j := loadLibrary(file);
1 Q. s5 D1 k+ F6 [$ k% E - 8 b/ @ ?: y% u o, a! v
- if j > 0 then0 O1 a+ G& g3 G1 Z9 g( v+ e/ J
- print getLoadedLibrary(j)," is loaded.";! |' F- I! y9 \ D. o
- - T1 W/ |) X6 e7 u) h/ S) \
- r := callLibrary(j, "calcSin", PI/6);8 a. H/ `% O6 s- C5 k4 V9 d* f3 H
- promptmessage(to_str("sin(PI/6) = ", r));
3 N b5 ]) L1 Z8 c# [ l: q" `, h -
; H6 U8 O9 n. ~+ o - local str:string;
6 Y! u( Q' H' Y! X- P- H) Q+ k - str := "I'm OK!";- P, Y1 J2 F* c2 O0 t' [3 Y8 o
- str := callLibrary(j,"resetStr",str);! @9 b1 k6 n$ ^+ z* z
- promptmessage(str);; a6 ]$ |6 y+ @! L
-
# F+ z+ F0 Z8 ]# m% I% M! C+ o4 O - callLibrary(j, "listAccess", Tablefile);
8 \2 p7 ]( [4 p$ e% w; ^ -
4 e& a: O3 T0 m, e* `- a1 g - print "Unloading: ", freeLibrary(j); a9 E0 Y0 O, P# M
- end;
t- ]" m( C$ G - end;# V& f- }1 ?: V
复制代码 |