- is
+ D* T& s- K3 b% ~+ Z, ^4 z - r:real; file:string;
* T. K7 z) G/ N$ \+ ~3 z - do+ r$ F. a' y4 d" ?" d
- openConsole;3 a" a8 a& w) H5 J- f% `9 C
; N0 k5 c2 V @3 m, I, x- /*
, j0 J/ R. E2 V1 E+ V, q! |2 m - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
z b0 ` l. K, `6 L - when is64BitApplication then 64 else 32,
w6 B6 d3 ^) k' C* [ - "bit.dll");; Z8 N% E6 H: O& \8 A% ? B
- */+ Z7 d' f: N+ R) H b5 x
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
) i# ?) Z6 V! F. z' x - local j := loadLibrary(file);0 Y! [. z( q) _1 _, r9 b
- % N. K" W' s. k3 Q
- if j > 0 then0 Z/ h5 W' ^' W
- print getLoadedLibrary(j)," is loaded.";9 c6 j' P1 q; V% d% _
- : X7 W. r$ W/ T7 _: y/ _
- r := callLibrary(j, "calcSin", PI/6);5 n/ E2 K/ D: W- C' Y0 v' A, r
- promptmessage(to_str("sin(PI/6) = ", r));- Z$ A" ~& c* g
-
, j. C$ A! j) l: Y - local str:string;
( Z+ E! K6 ~" O - str := "I'm OK!";/ S' L% M8 `! M2 q( q
- str := callLibrary(j,"resetStr",str);
# b; T. I0 R$ H) T - promptmessage(str);
) T7 f7 k- h* @) a, R! m -
8 w2 p1 A2 A9 V) w0 x$ e2 W. z - callLibrary(j, "listAccess", Tablefile);. T: j; N- t6 s$ h
- ( o5 Z0 Y% m3 b
- print "Unloading: ", freeLibrary(j);* P2 _: h, Q+ _1 W
- end;$ B# o3 Z- o3 B! \
- end;& p G) l- r/ L
复制代码 |