- is
# M- O1 M1 m8 ]7 h - r:real; file:string;
! ?) o, o z K" z' H7 @+ U - do
" \+ ^9 j) V! s( d0 S - openConsole;: X7 V& L" y! w6 K- `: i4 O0 H5 t
- & U1 o+ H) R1 M! l! F. c
- /*5 ?7 @5 i6 Z& t8 r0 r9 H* k
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
+ X) `' P; K# F - when is64BitApplication then 64 else 32,
3 Z% N( c- i3 G/ h8 Y2 k% d - "bit.dll");/ J$ Y; h% L- q0 h3 _/ ~% R
- */+ b2 m! a' \ w& K2 N! U) _2 R/ W% |9 c
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";' K% ~& j6 ]% e2 B3 Y9 ~' H
- local j := loadLibrary(file);& r9 \8 M0 t# `1 Y; d
- 8 J: B7 @9 d& T. O3 X2 T2 H
- if j > 0 then
* W7 U1 b! j5 r- m) J* Y - print getLoadedLibrary(j)," is loaded.";
; ]4 f/ I R2 R% W" I2 x! y - ! I7 ^' s4 y" @4 q( r
- r := callLibrary(j, "calcSin", PI/6);9 H$ h/ Z8 W* L( Q
- promptmessage(to_str("sin(PI/6) = ", r));+ b. E0 v/ i% d$ k+ e
-
; b) R5 o" N. {9 O' g+ L - local str:string;+ Z3 \6 C! i) H( j. A$ n
- str := "I'm OK!";
+ g. f* [& ]0 ^& v1 z4 d; I - str := callLibrary(j,"resetStr",str);5 c6 v. O' T" E! f: |" v$ G! {6 @
- promptmessage(str);0 b p; J1 P* o, s/ c! Z
-
5 `# m$ C2 x" ~0 |* }2 O/ \ - callLibrary(j, "listAccess", Tablefile);
: k! X# u2 U" z) J8 y0 [* { -
5 p! X* D. g/ U& ^8 |+ { - print "Unloading: ", freeLibrary(j);* v" D+ m" i+ V8 |' \3 i! F
- end;
% `+ Z4 {; ~) c8 b- } - end;
1 b6 h8 Q6 ~7 [" j' L
复制代码 |