- is. y4 `* G6 o2 ] F) k9 Q
- r:real; file:string;
2 K) I, `! h4 A4 [ - do
% e7 P7 O: P# a: C - openConsole;7 v+ M" S; q& }9 A+ Y8 G
8 d7 w) b) F+ `. |" ^! C* [9 |1 f- /*8 A0 a' ^& l8 W9 f V) P
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
+ ]8 V5 b, k# |% i8 C& ]! N - when is64BitApplication then 64 else 32,
y( R- t9 i% m - "bit.dll");% [, ~; f; [- A, i5 D1 t
- */2 I4 ?# g! L$ k. |/ g) K' Y
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll"; j2 L: d( Z: _* S2 `+ \$ V" z9 s) D
- local j := loadLibrary(file);! ?9 m2 D* t, b
* e: p/ f% @" M" g4 l% d- if j > 0 then
) f/ @8 E n6 V' E# I% Z! O - print getLoadedLibrary(j)," is loaded.";: g+ f# P/ Y X/ j( W& f5 [
- # E$ D; l% x' L/ \3 N
- r := callLibrary(j, "calcSin", PI/6);# i1 M. U" Q. g+ Y( Q
- promptmessage(to_str("sin(PI/6) = ", r));4 [7 r" R+ I8 T3 @* d" z
-
: |) O( U6 r. Y - local str:string;
/ l5 p! r* E) M) d$ q2 U - str := "I'm OK!";
$ m/ l+ H4 w) U6 Z. I q/ j; v# n9 I - str := callLibrary(j,"resetStr",str);& p* T; O( ~# t3 h/ n4 f( @
- promptmessage(str);
+ ]; _0 O5 B0 q' I9 }3 h - + U* Z2 T/ W C. F9 \% ]" U( a* C' p5 d1 V
- callLibrary(j, "listAccess", Tablefile);& g9 T% k' D# s2 \% r
- 4 y! l# t' z {: a- o" |
- print "Unloading: ", freeLibrary(j);. O8 z3 m/ H# D9 M4 A( v2 T' j
- end;
& e) ?- p% @: C! k5 j$ R4 M4 ~ - end;! `/ w0 `; O# ^" [0 g
复制代码 |