- is+ x4 D$ w1 [) M+ o* W: b
- r:real; file:string;
$ l- H# f4 \6 \& z9 S+ x - do
- k: }, T/ U- y3 a( v4 E7 g, Z- Q - openConsole;( ?/ g d8 \% n) ~7 e+ ]
8 ]! P/ K# d q- /*
; h) x, R9 X7 K - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",5 M* k; U; G9 w7 M! |. H0 }/ ]
- when is64BitApplication then 64 else 32,
* A6 [" r, o, u4 d - "bit.dll");
! `; [4 l' m% k2 V; ?2 A6 L - */
* }2 d/ Y1 y. S) B+ b - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll"; m# D7 P( P# _" I
- local j := loadLibrary(file);9 ?' ?3 ?) K1 x* i: F/ M3 |
3 A# |1 g* U# K; b5 o* p* Y- if j > 0 then
* o6 j' A0 B! ` - print getLoadedLibrary(j)," is loaded.";
E# B% K6 T; k& Q3 e) \
' }8 |9 S3 _5 {5 P }: `- r := callLibrary(j, "calcSin", PI/6);
1 k$ t: `/ Z/ [4 o! {+ W - promptmessage(to_str("sin(PI/6) = ", r));
- k! e n0 a5 p5 V/ N -
8 t6 F- R3 n9 M h - local str:string;
( h6 K/ V) s: t3 X+ @ - str := "I'm OK!";5 w! }$ T$ f+ i( X$ p
- str := callLibrary(j,"resetStr",str);
, F! B7 o3 ^) v* } - promptmessage(str);5 M" C5 i) P7 h5 i
-
4 T ]0 H3 e; O- j - callLibrary(j, "listAccess", Tablefile);$ i6 j# y# ~% W' ~
- : w* x4 v3 ` f, t
- print "Unloading: ", freeLibrary(j);& g; N6 |4 \ x7 I& ]
- end;
3 P! S: d* j' @1 h4 f0 v% R! ] - end;$ ^, K& F6 v3 E
复制代码 |