- is
8 |8 D' n; `' _% w7 e) N5 z - r:real; file:string;! A4 _; D9 D" x/ r8 f9 l; s' e
- do0 @( }" P0 B& S& N8 O- f
- openConsole;- G# H7 X' C3 q7 W: C, W
. c2 l/ F2 X$ W; O, ^+ Z- /*
4 I; `. x# h# O& `) ?( l& B4 r - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",& J/ ?: \2 u; O, r8 `
- when is64BitApplication then 64 else 32,8 ]* t: K# }* H0 O2 B2 e
- "bit.dll");
- l- m/ U) s# v6 t, e, h; Y - */
) K- d& l0 g- N2 E2 J - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
* \& E. R- u: X! m. I& W - local j := loadLibrary(file);
( Y. F2 g1 ^* ~5 g0 t1 e
0 M* D3 J* r1 I) x- if j > 0 then
2 l8 n- ]" \7 Y: K- U8 ^0 X - print getLoadedLibrary(j)," is loaded.";% ~1 M2 y ]& V* @# G. F; f q/ O
: B' [0 _6 u' T# O }9 d- r := callLibrary(j, "calcSin", PI/6);
0 l+ Z; f1 |# j8 g( S# { - promptmessage(to_str("sin(PI/6) = ", r));9 |$ i v4 A- ]
-
- q* n+ d9 Q* a5 ^1 `5 l& P; }3 ? - local str:string;1 G, ?+ H* I) L$ B* o
- str := "I'm OK!";; ~1 P; E' j. O/ i5 x; d
- str := callLibrary(j,"resetStr",str);
9 Y C* {; K7 z2 J - promptmessage(str);4 U& g% J0 A5 @) m! A6 Z
-
5 l6 u0 B' [% J; Q - callLibrary(j, "listAccess", Tablefile);
2 ~5 E. L: w8 D% R% U; @ -
& T) M1 B3 {# @4 c3 I. Y9 K2 [ - print "Unloading: ", freeLibrary(j);
) \* [7 C n7 C# M - end;$ W9 Q0 m1 f; _
- end;
: D. ?+ T [4 Y! H
复制代码 |