- is
6 e) i- u$ m: |; Y6 F% y - r:real; file:string;0 d' l) r# {' K
- do
! ^2 T ]1 u, p; a! g0 Q - openConsole;
7 @" u8 i, }0 N* c: s! a3 Y$ N - 1 X1 s" ?$ B) Y
- /*6 A* K9 k. \8 L2 F$ H0 q3 @
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",7 S, L4 z$ J2 J) p- A# y V
- when is64BitApplication then 64 else 32,
! ^% u, k- [7 a8 |7 x D - "bit.dll");8 F* r# b5 H" y# }; Y& ]8 E/ H0 @
- */# w( ~- Z; @% g& O
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
& S" L/ M& S d k - local j := loadLibrary(file);
1 E |/ l( P* ], R H
, Y, m! ~2 A8 y5 e5 l- if j > 0 then4 ^0 T# z" H9 z4 p8 r1 X
- print getLoadedLibrary(j)," is loaded.";
6 f' h! k5 \+ [ Q; \ - 6 G! i: O* C& l/ \
- r := callLibrary(j, "calcSin", PI/6);. I; [! m6 v- q
- promptmessage(to_str("sin(PI/6) = ", r));1 c( J# Y6 g4 _1 C7 X
-
4 V8 T4 U0 }/ r3 p8 B* O% | - local str:string;) w# k& u0 V r5 A7 }. {# j8 @( C
- str := "I'm OK!";
/ p4 d) Y; U+ P* b - str := callLibrary(j,"resetStr",str);
( z) O+ W5 r; N8 a- u B - promptmessage(str);: m" [3 X" Q" j5 P; K
-
1 ?: i% I2 u6 L& S0 I A - callLibrary(j, "listAccess", Tablefile);
/ U5 i3 J/ X0 X) w* q - ) ^: S0 T7 g7 R, u( y* j. g- |0 J
- print "Unloading: ", freeLibrary(j);
- W' |5 ^& W6 V* e - end;2 L, ^, b$ @( x4 H8 k2 o2 V
- end;) P3 W$ @8 r$ h d- w
复制代码 |