- is8 j M G X9 P7 r9 b" Z L
- r:real; file:string;( V, j ~; n# ~7 `/ l e! t
- do- u/ v) U5 g9 e/ V& y5 d
- openConsole;$ [9 l7 t' e' p0 P3 ?" r k( o9 r% H
# n8 c- R& B; M- e9 A: B3 d- /*8 A2 [% I' [, h; E. b M( E
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",0 \& n' ^: d( B- o. }
- when is64BitApplication then 64 else 32,
- ]0 }; u& D( i0 j' K - "bit.dll");
+ h' o2 S9 l$ k* x( R+ J5 b - */
2 k2 o+ f& C. e! `& h! d# }- X - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";, N, L2 v8 k8 i6 C3 [
- local j := loadLibrary(file);
& A1 _1 c+ @( a - 6 T, g, t# {, n( {
- if j > 0 then
% p. H$ O! ]$ \( g1 b y - print getLoadedLibrary(j)," is loaded.";
. X! d$ }8 S3 e$ o( b/ z - / r, |* Z" g6 d) t$ D: m r8 E$ U
- r := callLibrary(j, "calcSin", PI/6);
+ b2 w3 u7 t2 L8 i, {! A - promptmessage(to_str("sin(PI/6) = ", r));( K) @4 J1 N; T W
- : U+ ~3 U ]: _; B) J
- local str:string;
0 H A$ H+ _8 t1 x7 ~ - str := "I'm OK!";
4 o; L7 n6 @9 u& ~7 W - str := callLibrary(j,"resetStr",str);
* r# x6 W" J8 s5 w. ~6 r2 Y - promptmessage(str);
3 B. C, F, a( q1 O5 y& ~ - 4 N2 j7 L) J" t0 y/ H+ J
- callLibrary(j, "listAccess", Tablefile);
% H$ G9 \4 s+ R$ I8 d x -
0 D+ K" {# ]+ H" _* g$ _ - print "Unloading: ", freeLibrary(j);
# Q, A) ]6 u; u) J4 G9 |% K - end;
3 ~0 U+ c7 L7 Q2 K7 U, z3 s' O - end;2 l5 Z7 V4 e# |* L/ Z, }
复制代码 |