- is! A& g4 F, V2 P( D
- r:real; file:string;5 i: b+ I. S, L, `7 `& N. }% j
- do+ N# k4 I" a6 A8 m; M
- openConsole;% ^ X$ \8 N+ q" u, @7 v
@' F/ O7 t; Z: d- /*; K$ P" H. x* Y7 G1 a- u4 k
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
) h" ` Y: m$ H - when is64BitApplication then 64 else 32,) v& D( b q$ J
- "bit.dll");5 W/ ~3 T3 w8 O7 M% u W
- */ N$ d9 n0 z' C: V6 I+ {! Q( [
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
( Y3 u+ R; ]) z& p1 s - local j := loadLibrary(file);
( W! H6 Q! m( y, j - / t4 M& [7 j* ^4 B' q9 T0 W
- if j > 0 then* }9 n1 y. E" u
- print getLoadedLibrary(j)," is loaded.";1 R( U. n+ l3 `+ q o
- + U5 F6 Z' i8 X7 c& q, L
- r := callLibrary(j, "calcSin", PI/6);: {+ j' E& a* F* s
- promptmessage(to_str("sin(PI/6) = ", r));
; {# }! `+ N+ w' J" O7 I$ v8 f -
1 i( q& n; C+ P, q N/ d8 z) d - local str:string;1 W/ C: x( N) E( F# X( ]* X
- str := "I'm OK!";; F6 a- S! i) l2 r6 Z1 v7 [3 B6 f
- str := callLibrary(j,"resetStr",str);0 I1 V( T' X' q4 I" Q. ^8 R! W! |0 w& B
- promptmessage(str);
9 T" j/ i: {; w2 B! z& ~; L -
4 Z6 O# Q6 I) ? - callLibrary(j, "listAccess", Tablefile);
) G6 B6 y. C8 R( R( J3 R! U -
. n3 T0 I+ a9 Q0 ?( L3 x - print "Unloading: ", freeLibrary(j);7 E: W/ \, d2 q" H: c `2 h- B
- end;
5 Y7 T3 X: K# f# G - end;
7 Z3 J4 c3 H7 a4 E) |
复制代码 |