- is
3 M: Z) `2 a( N$ `" Z7 V - r:real; file:string;
# @9 b& Q' u% ~/ Y - do
) O. Q5 ?. g7 x - openConsole;
' V- W1 I7 [$ m7 W n' ]$ h
8 U+ I( b5 B) b+ F8 K* i, Q- /*
- ]" \6 V. W, |' r - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",1 @0 L: n2 U; k$ w4 g' @+ K) o
- when is64BitApplication then 64 else 32,! k4 B7 d1 x: o5 a- [
- "bit.dll");$ x! I$ ]2 u( [* e4 Q" b; x/ h
- */
( M; Z& B7 e+ p9 V8 U3 P - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
7 T( m# h' X0 {+ ?4 ^ - local j := loadLibrary(file);- a' S6 t7 o0 ? ^" r9 B
- + V2 }# ?% e0 P7 ]' E
- if j > 0 then) p1 X# W+ ]6 P
- print getLoadedLibrary(j)," is loaded.";/ u, x1 P" k5 c) i) W, S
# l/ D" W/ F$ s3 ~1 `5 D2 u- r := callLibrary(j, "calcSin", PI/6);
7 r) U4 Q( A4 U5 H - promptmessage(to_str("sin(PI/6) = ", r));# {1 p; [3 u) c( Q# j, f. C. F; D
-
' Z6 P2 X `7 `5 x- x7 k - local str:string;3 p0 p6 S+ \2 Q! y) R5 \
- str := "I'm OK!";
+ z! W8 C p6 W, b1 Q% { W - str := callLibrary(j,"resetStr",str);; T& J( T4 k. F& Y5 x" b
- promptmessage(str);
( }3 O* r8 G+ O - . T% _" E% V( @7 g I2 x
- callLibrary(j, "listAccess", Tablefile);" H0 `1 Z- n/ X" K1 O- C: {
-
0 \; |6 m& ^, Y% J7 m# l6 K - print "Unloading: ", freeLibrary(j);
+ c# y/ b3 V2 p, `1 r( u - end;9 t2 h- U$ N2 P
- end;1 G9 @* v# z6 Y' {0 ?! k
复制代码 |