- is
" t5 v/ B: C9 l; P0 s' U - r:real; file:string;
' z% P" ?) e; H8 U. _( l4 }# I3 D3 y - do" k' u6 u4 Q( H# y- Y- w3 z: J
- openConsole;# y7 R& ~$ j4 S5 c& ?+ G
- ! s/ r( o5 R1 e: b# Z7 E4 T9 }
- /*
: p/ t Z ]9 V$ I - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
7 h; N& |, F f - when is64BitApplication then 64 else 32,
5 q8 W: k& l [$ w5 ~2 G - "bit.dll");
9 Q. ?/ m! k' ~& A9 \. M. E - */6 {# S) {. I$ S7 R5 x
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
2 h6 c% L; Y1 `* ^2 H% S - local j := loadLibrary(file);
6 d0 L/ I8 K) f/ k - 8 y2 A% D) D4 _' E% |
- if j > 0 then7 A) ^' ?1 ]$ L5 }+ }- Z
- print getLoadedLibrary(j)," is loaded.";
$ r" R, g% |0 b: n# Y - ' n$ V' R' h. a/ Q8 w! T& `
- r := callLibrary(j, "calcSin", PI/6);
% Q2 _7 ]' y. D; t0 \6 o - promptmessage(to_str("sin(PI/6) = ", r));
$ u1 p8 D& _5 t3 ? - 6 x+ d+ w: N+ M, y$ e5 h
- local str:string;
( n2 [8 G, C9 b$ k* c% W - str := "I'm OK!";0 ~/ j9 \5 N; B- f
- str := callLibrary(j,"resetStr",str);0 r! ~+ C; g- j* F$ Q9 ]
- promptmessage(str);
4 i4 z- N5 {0 } - ; A/ M$ c" _: n; L8 l: D' U
- callLibrary(j, "listAccess", Tablefile);
+ u! @5 ~6 n) f% m# ?5 {% B) i - ; ^. w8 C2 f: s o
- print "Unloading: ", freeLibrary(j);' l* z5 C, ^3 E% Y3 ]
- end;
4 f# T$ `- H! I5 K" I$ K1 G - end;
; H% c) a+ d# K5 r R* w8 v
复制代码 |