- is
/ u" }+ U; N7 O+ a4 g - r:real; file:string;2 V2 Y" n/ c4 p7 Q% O
- do+ H: Y2 v! z( {$ Q; ]. ^; N! O$ q
- openConsole;
! H) c, A) A+ q9 v. r/ w/ s - 6 D4 o2 u. S" ^; n
- /*: c+ U8 T2 r* U5 b. \4 b
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",, `0 Q; y$ J0 ~( U; `9 ^
- when is64BitApplication then 64 else 32,
2 L. t) y0 r5 C4 x - "bit.dll");
) F& H$ ?1 a8 e0 F' } - */
- p; @4 g0 ~1 D( r. e6 F - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";- o- d6 ]5 C6 P9 \9 g
- local j := loadLibrary(file);' O0 N2 p" _0 [$ f# W
Y8 Z3 ~. f: e# x. R* N- if j > 0 then
. v$ A: ]1 `8 n P. L& Y - print getLoadedLibrary(j)," is loaded.";
0 M) x- P/ S2 c5 o S1 i3 f5 h
$ O! y* N9 u( N/ Z- r := callLibrary(j, "calcSin", PI/6);% O: \9 }( t8 E" e+ Y8 d" O. i
- promptmessage(to_str("sin(PI/6) = ", r));
6 _7 G) Q# t& X, `7 _. ]% Y5 h -
5 B' j2 u7 w5 Y1 \ E - local str:string;
% l7 H7 Z: }) \& v# c, [% }) c4 Q - str := "I'm OK!";# A- N1 U; z' @5 w/ i; `
- str := callLibrary(j,"resetStr",str);
* A; h a! e" Y7 O8 \0 W7 A - promptmessage(str);
' s1 ]8 a9 R# Z. y2 ? - 8 m8 I4 p: Y9 H4 i
- callLibrary(j, "listAccess", Tablefile);3 g E1 O( A1 T! |
-
5 r5 W. E) f5 n4 G, W) Z5 } - print "Unloading: ", freeLibrary(j);
6 _6 [8 L7 D$ t6 ?+ b - end;. g( M9 c4 y; f! j
- end;
! Y: v, K% C( H0 C& {0 X
复制代码 |