- is
_+ V8 V- T N' _# G( c - r:real; file:string;( m- [" E5 H5 p
- do0 c8 q- i0 M2 \& e% V. k% F
- openConsole;# R! u8 c, o' S/ j b4 W, s4 y
( t8 n, m! F6 H$ G b0 d& F& \' Y- ?- /*
. F* a u: O% z: V4 _ - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",% k! d% y; @4 y2 ^8 O! N. `- ]7 @4 M- ?
- when is64BitApplication then 64 else 32,
4 D$ \' ~& p0 ? - "bit.dll");
9 P( f u3 a/ K. ?' J - */
@$ B Q! m: ?! ` - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll"; d |0 h" F& s! X% _: A) s
- local j := loadLibrary(file);$ K3 n5 E, g4 _8 {
- , I% x5 Y. L( f- b
- if j > 0 then
8 e' ~# L+ t: j - print getLoadedLibrary(j)," is loaded.";1 I! z& g7 s4 s5 d C- |- }
- 4 |( C# N5 v( N$ n- r! V
- r := callLibrary(j, "calcSin", PI/6);
) ^- U- t. e0 ]; w9 C5 @ - promptmessage(to_str("sin(PI/6) = ", r));
" S" y2 A/ Y) d5 U% g8 V/ @/ \ - 3 R0 @4 {2 V6 y, j
- local str:string;
5 L& e* \* n/ n0 q3 P$ _; k - str := "I'm OK!";* Q, Q8 r0 w4 _0 a. m
- str := callLibrary(j,"resetStr",str);
% S1 Z8 h6 ^: v& B. h - promptmessage(str);# G2 E4 R! ?" q- X9 u; A6 F# q4 C4 Y
- 9 a8 ^9 g" M h# Y! B
- callLibrary(j, "listAccess", Tablefile);
/ R5 O; ]: z9 H* a [ -
% ^( j7 J. A( Y3 W - print "Unloading: ", freeLibrary(j);5 X4 [6 @ A: T7 g! k
- end;
( n) ]+ Q F) W" M/ R2 p' Y - end;6 H: A6 h) k4 ~$ R
复制代码 |