- is
3 t! B, t+ D! M! |7 D* M - r:real; file:string;0 E$ | B9 i# r
- do
4 ]! W; }2 f% a8 m; S: ]9 p - openConsole;
0 p: u% C; F. }7 R/ V: X - " M; Q- u1 A; z! M( {6 s& O2 P
- /*
: ]7 ^" N! \& P7 D& N( d - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",6 e- n' ]! A% E2 V9 \# d
- when is64BitApplication then 64 else 32,
6 A' d; z& h* V4 K5 ? - "bit.dll");
( G' `- e1 n1 n- r& [ - */
7 H$ u# y1 W ]+ a. S' C, T: b$ g - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
( z# H6 w7 s/ b* W: l5 F5 {* J - local j := loadLibrary(file);! l- L: S4 n- T% L) U& T2 E
- , r E% l+ R2 {" |" I, a3 N
- if j > 0 then. o5 `/ }7 d6 \+ X Z% z0 g% t
- print getLoadedLibrary(j)," is loaded.";' z, n4 _8 Y% o' `" ~
5 i4 |* Y$ n% n" s- r := callLibrary(j, "calcSin", PI/6);
9 t7 I4 D% N: T- V - promptmessage(to_str("sin(PI/6) = ", r));
/ t0 D6 F3 O- z$ v7 K5 f( b9 U) G -
0 T9 _5 |7 Q/ i& q - local str:string;
0 Q0 S5 n) Z) e- h- B - str := "I'm OK!";
3 [! f. p$ N, u& A4 J - str := callLibrary(j,"resetStr",str);
3 }( c/ T0 M8 A: w: O - promptmessage(str);
) J' ~2 n. {1 [. J" C D -
5 [' Q& t% q$ b( r! e7 C9 f2 K - callLibrary(j, "listAccess", Tablefile);4 c a4 ?) T& n! `: D+ F6 ]9 y; O5 i
-
) ]9 H/ ~7 n3 d. o: k! A. q, \# C - print "Unloading: ", freeLibrary(j);/ h% m I( `) T6 j& A
- end;6 x- `5 |; p* ]3 c9 e/ m2 I3 K
- end;
0 |* t a; n( b+ G( R7 d
复制代码 |