- is- ?, Z9 i* f( M
- r:real; file:string;. T l5 ]- P: S* R
- do7 z8 ]- O% T) i) \
- openConsole;
7 @0 U7 {0 W* ]" D( O b8 H
0 V& F" M ^. R/ h- /*
1 x. ^, `; h. N. @+ ] - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
# ~, y* P4 R' @% R - when is64BitApplication then 64 else 32,
% Y* a! W& i8 _* {6 P4 a - "bit.dll");" W8 @: _3 ? g/ v% }
- */
1 Y l4 _7 H. r% \1 g6 f2 L$ l - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
4 ^, E- V; e7 C. V2 q; I - local j := loadLibrary(file);
- y; h8 v+ d& s% Z$ L
! h; Y) r) [5 g. C- if j > 0 then
/ b; h) H5 z$ S+ k' D - print getLoadedLibrary(j)," is loaded.";
" b0 u7 c. C. X+ [; `3 }6 X
9 H# N, ^, Y& n6 A ^- r := callLibrary(j, "calcSin", PI/6);
, s* |7 E1 J1 }9 u5 i - promptmessage(to_str("sin(PI/6) = ", r));
. a W' q* V9 T6 _ -
+ ^0 s- V+ r2 D0 ` - local str:string;+ ^* s0 ^ Z6 z
- str := "I'm OK!";
8 T2 Y: l7 c9 k3 s* r1 ? - str := callLibrary(j,"resetStr",str);
9 b8 P6 L F. [0 r& g2 b& [3 ` - promptmessage(str);. l, i2 N; R1 B/ h, _
-
- e% z1 q( |' K# \ - callLibrary(j, "listAccess", Tablefile);
) O) m( e: ?6 i7 x+ j3 ^- y -
3 Z. H/ b" M2 Y: g - print "Unloading: ", freeLibrary(j);
% V. A. F, u* O1 @) m. J; t- O3 Y - end;1 u. _! {: r! U( C% n
- end;
+ f1 p3 i$ ?, K0 X I
复制代码 |