- is
/ I0 t. J8 r F9 [( f8 F4 t6 S - r:real; file:string;
; j7 D; i# ~# R M - do
& m8 X/ Q" ~2 k& P; b+ e - openConsole;
% S6 k7 X" d( ?6 R+ N
3 c- \7 f: x* s6 I$ N- /*; z% m+ Z# x( P" z5 O6 P& e
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
4 R$ M- _# w8 S! O% X/ t5 p$ A2 j - when is64BitApplication then 64 else 32,9 T8 w% P* V3 H
- "bit.dll");1 D# K0 X- ]5 `% v" C$ h2 C! z) e
- */+ _) `8 W4 w" O7 _+ A1 l0 b# ^
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";3 \2 _/ e' y3 W/ W$ t
- local j := loadLibrary(file);
: Y2 r. B! O' w: W7 |9 E; }
; }3 z& h8 b. k# P- if j > 0 then) Q" [! b2 _. G, W4 N# k& l
- print getLoadedLibrary(j)," is loaded.";
s+ F1 A" \- T) T - + B* B$ ?/ I$ _" B9 \, W+ _& U- ~
- r := callLibrary(j, "calcSin", PI/6);
# ?) _2 z; P5 o/ _ - promptmessage(to_str("sin(PI/6) = ", r));
p3 ^6 f! Q9 T0 H9 X - 6 H' u. a$ g; D8 W5 K( p
- local str:string;
* f8 M6 g& ]9 M7 Q - str := "I'm OK!";3 _9 i! ~1 D6 @) m3 d% i: }5 U
- str := callLibrary(j,"resetStr",str);
5 K l) F, a/ ?0 e - promptmessage(str);
3 G. f% q. T2 p U w1 o0 U% H) c& z -
2 ~. L; O* ] O- v/ T6 M - callLibrary(j, "listAccess", Tablefile);3 j. W" p( ~6 }$ k# ^9 O2 e: y
-
3 J( n1 w" R3 K: q# q/ f - print "Unloading: ", freeLibrary(j);
u8 L8 W% O: E' [, k7 L p7 y c - end;0 m. @9 g/ p% m- V$ v3 z
- end;
+ p/ }1 z6 o2 ^' s& l) m8 g% i* Z
复制代码 |