- is
' F1 j: |+ @' |" T: F3 t - r:real; file:string;+ A* ?- h* E' M% x
- do& W$ R% g$ I$ s6 K4 _: |
- openConsole;
. Q* a. B: ^2 t% C: @+ u. t - / P7 ?2 k. F# E d) H! v
- /* P6 K! Z2 _0 {) q0 c6 c" P0 U
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",5 `& X! W, ~8 D, ^0 P& I
- when is64BitApplication then 64 else 32,4 j* N# s, I; X
- "bit.dll");
" a9 r* h% j9 Q6 j( N; Q5 x - */2 V- G! H$ Y$ Q. u9 i
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
H: ]( A9 C& R6 J, _ - local j := loadLibrary(file);
/ {$ e) P# w4 [( E. H. {
' w8 i) h6 F, @$ T- if j > 0 then$ b* m5 E6 g' S" Q+ S9 V3 e
- print getLoadedLibrary(j)," is loaded.";
3 k9 k& I, Z# a& R _
; I. i) k: s& O. `3 {9 `- r := callLibrary(j, "calcSin", PI/6);- Y, ?! Q8 C& L/ b4 x
- promptmessage(to_str("sin(PI/6) = ", r));
/ ]8 ~! p/ \9 ~4 `* @, @ T - * S) X+ i( N$ p* N1 r
- local str:string;
% s3 |2 P4 h) z$ s* P - str := "I'm OK!";
# Z, s' o# Z# B- y' l; F" @ - str := callLibrary(j,"resetStr",str);2 e2 H1 H' k$ @3 n& k3 Z
- promptmessage(str);4 p+ [7 v% H: y {4 K
-
3 \; d3 B3 t7 y- i$ V5 V/ [ - callLibrary(j, "listAccess", Tablefile);
c( y' U" P( Z7 o - 7 l) P( e/ v1 u& {
- print "Unloading: ", freeLibrary(j);: U: U) y6 h8 P5 N7 B4 M" j
- end;/ h0 h4 ~/ I, {$ w: M G5 R% j9 i$ }
- end;) K: Q: R1 S, q/ {3 a s' j: V
复制代码 |