- is
; k G& D* R) B, V" D; ] - r:real; file:string;
2 `) ^ Z2 k( s/ s - do ^- q7 ~! O2 K1 L2 h$ k
- openConsole; V0 z; |8 U" \& L0 I# l9 z: [
( H m1 M; Z6 r) a/ O# k. r- /*
: p5 W1 O, G* k9 \! u) F$ F - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
' ?* |, {. ^* f) O3 l# f - when is64BitApplication then 64 else 32,
) n, _/ \4 u* v' {8 S - "bit.dll");
' t/ G! r, s# V/ `( P! n; Z! K - */6 W2 n1 a. }3 H J
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
5 ^$ C( m+ f5 u8 q, r7 J - local j := loadLibrary(file);
0 h8 Y7 g5 @: E4 C& Z' K
/ _3 C' X& r1 K1 R- e# `$ A- if j > 0 then+ I9 |. p+ e) a# o6 |7 q
- print getLoadedLibrary(j)," is loaded.";
. R+ T5 W+ g9 l& S
. Q% I$ b1 B5 Q( m2 v# d- r := callLibrary(j, "calcSin", PI/6);
1 y5 ?) J ^+ t2 ]+ t9 c - promptmessage(to_str("sin(PI/6) = ", r));& H$ x8 @) G* ^% ]; Q2 b0 ^
- " M2 Y. C8 k% }6 b4 G! w- U
- local str:string;
# E+ ?9 V/ s' I0 v# } - str := "I'm OK!";& z" }6 x# v! t7 a, }6 F+ S
- str := callLibrary(j,"resetStr",str);: l a" M2 I" ^6 k. d- a
- promptmessage(str);5 l4 m8 p( e& T& y
-
8 B {7 ?: {" w. B/ r) c' F- { - callLibrary(j, "listAccess", Tablefile);
) u% N% ~! \# _) G: I4 y' j: _8 i -
+ l+ @4 @1 b x7 s3 q* G - print "Unloading: ", freeLibrary(j);
1 d: O; V8 s5 ` - end;
3 `$ ^& ^; Z- f7 d - end;' G6 o) E- L: P# Z& \
复制代码 |