- is
! [' ~7 K: r% r1 V1 Z6 g9 J - r:real; file:string;; Q. d2 c- C3 a' @1 E+ `6 M. _* z& ]
- do
$ L. [. _: f; U# L0 { - openConsole;
/ ]+ n q2 h2 v3 y' `& \* E - / L4 A/ N7 Q- t% F" h
- /*5 t1 ], h- b) \( h3 }$ o5 ^
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",1 Q1 s) Z2 D2 F$ L* b6 N
- when is64BitApplication then 64 else 32,
/ ]1 C5 K* N% S9 f2 t$ p1 F - "bit.dll");
- Q/ N0 G; i. M; j' Y/ l - */
8 a J' }. q1 d# G$ q - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";$ f; {0 B Y( V# C" _
- local j := loadLibrary(file);
8 l. o; }* A5 k4 f+ _" m8 w0 t - ; a J8 T$ O* X
- if j > 0 then4 T. Z* @) ]6 U2 r
- print getLoadedLibrary(j)," is loaded.";
! D) S( N2 E7 j) S) D: B - 0 y4 p) \3 O0 o
- r := callLibrary(j, "calcSin", PI/6);
3 o: f+ m. N/ o9 R - promptmessage(to_str("sin(PI/6) = ", r));
- i% j [) r. O6 E& x9 X - 2 N2 l* v" o/ [& f& V) g V
- local str:string;' G( _ e* _8 I; h+ x
- str := "I'm OK!";) s' i; A% y. v4 R: k
- str := callLibrary(j,"resetStr",str);
1 n6 Q, t2 I% p8 p+ ~ - promptmessage(str);! m. K6 b: v7 d' R
- ' U) o8 b8 Q+ W. ]+ ?
- callLibrary(j, "listAccess", Tablefile);
& X1 f% F6 M+ g( n -
# {$ @! s5 U/ M& H8 f+ ~+ h' B - print "Unloading: ", freeLibrary(j);
: O4 F, b: l1 ^- R5 x - end;8 x" J5 U2 E; J, Y8 g9 ~
- end;8 v* R1 L8 Y# `1 X
复制代码 |