- is
/ `7 L# ?6 z, z3 S: V - r:real; file:string;, u0 M$ ^8 t2 }: G- S
- do
7 e! l8 f# D$ u4 H$ W - openConsole;
x# W6 F) T9 ]/ `: w, V
% z8 e2 L9 B8 y/ C5 W& Z! k- /*
, V/ T- i& D' k8 o - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",7 |3 o/ I2 R- I P/ x# @0 V
- when is64BitApplication then 64 else 32,8 T& H5 t: Z+ C% |4 T( y
- "bit.dll");
& V/ U, b9 L$ q$ ?1 d* A3 K - */
" N$ v/ o& o' Y2 U - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
5 A$ a, }& D% |! I4 U - local j := loadLibrary(file);
! D9 e( s2 J/ H5 P - & I/ M5 z8 O/ d9 n( w
- if j > 0 then
3 }7 _8 }' C6 P - print getLoadedLibrary(j)," is loaded.";5 s. {0 ~+ B7 m3 o! O! [4 k$ d
/ {. |1 |/ ?. I. u" x2 w- r := callLibrary(j, "calcSin", PI/6);2 Z( {+ X0 p2 l
- promptmessage(to_str("sin(PI/6) = ", r));2 J5 y6 y: g( T' p
- ' J$ B$ c8 U8 g0 z8 C9 K' z
- local str:string;
& b/ Q' V0 o8 `7 P, ] - str := "I'm OK!";/ O/ @9 g2 x: T$ |+ [6 X
- str := callLibrary(j,"resetStr",str);
7 ~& _4 P+ R5 r# C3 W - promptmessage(str);
. }6 U+ Z7 A2 u0 [ _, _ - ; h: k/ X) K8 Y @0 c
- callLibrary(j, "listAccess", Tablefile);
, p1 v! `: s6 W" j -
' B7 K, W" i. ?( n4 P, k - print "Unloading: ", freeLibrary(j);
2 H. E4 V% {. S% _- f4 ^ - end;4 }9 X! C: p6 }3 U+ }- k. c4 v8 s
- end;
) T4 e- n# ?4 v4 L$ t/ } X
复制代码 |