- is
4 s8 e' y0 s& n! I: G - r:real; file:string;
& R% i% U* G" b" O - do4 }4 D/ X0 ?/ ]7 v$ Z* |
- openConsole;
* L# q* ]. T( j m; [7 F - 5 G G/ E9 p e/ L! v/ F9 z( ~* [
- /*
% P- u, a, u* ^ D - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",+ @/ l% R o# U7 V; M' p
- when is64BitApplication then 64 else 32,
0 ?9 E: }5 m% \ - "bit.dll");
. y& X2 G: A8 A - */
, O: U: H, C$ U# J% q: H+ W: P5 Z# X - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";$ N, ]2 Z$ B( {6 _4 c7 B- h; m8 B: n" \
- local j := loadLibrary(file);, k: L5 t! f3 M) b2 O( U
' m7 Q. K) ?5 |- if j > 0 then2 Q7 f* V% ]$ b- y+ I7 V
- print getLoadedLibrary(j)," is loaded.";0 J5 G, c1 n2 t: v
! ?9 l6 c5 h1 w, C7 x" w) y) P4 i8 `- r := callLibrary(j, "calcSin", PI/6);4 l" |" ^3 u% L8 ]0 ~) E) b
- promptmessage(to_str("sin(PI/6) = ", r));
: p3 u9 P& {4 W' F+ S4 t -
: _% z$ X: a9 G4 T- r - local str:string;
; {9 A1 t, y7 `1 T1 f - str := "I'm OK!";
3 f) [* b2 }8 u# ?4 P - str := callLibrary(j,"resetStr",str);
0 j% ], ]+ M7 o - promptmessage(str);6 B+ h* w; K7 p" X; m
-
* x& Y. \3 l6 w q2 g: S" R - callLibrary(j, "listAccess", Tablefile);, v7 n U* a8 ]
-
$ u' n+ O% Q" U/ {" i! p - print "Unloading: ", freeLibrary(j);* y$ I. B! L5 M' m/ R# z( C
- end;
& N |* N' t6 ^) d7 f' \ - end;
% Z8 q. [- f) H. L
复制代码 |