- is
5 Z9 G4 V7 v9 T' n% p9 F( Z - r:real; file:string;+ O$ y$ r+ i2 I) {. R
- do
2 R+ q* M# x# {. v* s - openConsole;
5 }: |, `; Z7 O8 L( z4 i+ [ - ; o" T4 }2 |' [9 J, s4 j
- /*
3 E) s) @. @# M2 a3 P - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
: \# ?1 L: D. u3 i% p - when is64BitApplication then 64 else 32,
- r5 G" X+ v+ m1 }% n0 T - "bit.dll");' y0 V- V3 P3 i' t! l
- */
6 f, s4 @5 R( h l - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
' z) E' a# J$ a - local j := loadLibrary(file);- I7 B, ?( X$ \9 c" F$ x( \
- ' R2 t$ R1 S& m9 z' K
- if j > 0 then, T* x9 c* `# _ }' s0 v* R. u
- print getLoadedLibrary(j)," is loaded.";
B4 X$ Z$ O3 o5 i) a - - v1 H9 P& i1 w+ @: |4 n: n
- r := callLibrary(j, "calcSin", PI/6);& y5 J+ W9 S$ M+ _
- promptmessage(to_str("sin(PI/6) = ", r));/ H \( F D9 j/ R# {0 ]: t
- 8 A+ `, R# c; Z3 H% o! O% d
- local str:string;
# A* a1 g( G: E- B0 }# y4 B. E& K. u - str := "I'm OK!";6 u1 R0 h3 z0 b$ e& q3 N1 o3 p
- str := callLibrary(j,"resetStr",str);
# z- n3 Z; b8 H. i - promptmessage(str);2 A) W0 [ X7 H$ m% Q
-
6 x! R7 u9 j6 m6 P - callLibrary(j, "listAccess", Tablefile);3 O4 C! k; ?; v4 ?
-
# r2 Q- h U6 N8 v6 Q; [! W: V - print "Unloading: ", freeLibrary(j);
0 c4 g' v+ n% n7 U; ~9 j - end;. o7 t2 I4 G1 C- ^! z
- end;
. K9 I' t) u3 j2 M. A
复制代码 |