- is
+ G# L& A' k1 {) m0 H2 S% U - r:real; file:string;
5 ?0 U: D0 E) q9 ]/ R9 O - do4 B9 Y: @( G7 E$ Q) [2 d
- openConsole;# M& W) u& t5 o6 \$ ?. H1 s
3 L0 I" E& ]7 C2 V: I7 k# k- /*5 d" j' h8 G! l/ C& `7 j
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",6 {0 d8 U9 T5 C$ F
- when is64BitApplication then 64 else 32,7 s- C7 q" v: `- Z
- "bit.dll");
$ W8 i/ }- e/ O - */- I1 q) Y3 T. i I
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";; f r9 i3 q; v; l- e8 b0 |
- local j := loadLibrary(file);
! m. @4 j3 A4 f
5 a3 y3 h, H& n. ~- if j > 0 then. T) w2 Z) @, o! _
- print getLoadedLibrary(j)," is loaded.";! C! a9 a- o8 W- x* I, J7 a
% f% k8 O- j! W+ I2 D- r := callLibrary(j, "calcSin", PI/6);" k. k' x+ f2 ?( e; n; y
- promptmessage(to_str("sin(PI/6) = ", r));: ^1 X! _3 M+ R( q5 F
- - H* m7 M6 K% g j
- local str:string;9 k7 ?- r9 ~: V+ J+ f4 I+ W$ J4 S
- str := "I'm OK!";
) |6 l# G/ t& e - str := callLibrary(j,"resetStr",str);8 j, h& \# ~. B, x' a
- promptmessage(str);, a) U4 K% F8 q+ f
-
y3 D5 ]! u, n; a; s% h# U - callLibrary(j, "listAccess", Tablefile);
1 p# {/ i) Q: v, j! D7 \ @ - 8 O( n6 q9 q1 f+ L
- print "Unloading: ", freeLibrary(j);5 e! ~2 J8 ]& }$ p4 t
- end;
7 @! l, `# o+ k - end;; d( ~0 x& |' c" w$ S4 g% J7 }" a7 z1 ^
复制代码 |