- is
1 G. o, {6 `" O0 T5 W - r:real; file:string;
# Z* p9 X6 J+ l! ]& ? - do( F$ x& S1 j- z Z
- openConsole;( P& ~* S4 y B9 X
?9 ]5 ^6 Q2 {! R1 g F- /*& S* v2 }1 a/ V; X
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",+ W' N8 H4 ?5 D1 K. N
- when is64BitApplication then 64 else 32,5 [; S# ~: _5 [: _8 V0 A h* g
- "bit.dll");
# F) s8 Q/ G$ J1 I$ {! P2 I3 u/ v - */& l& ~ b5 u- o
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";7 D/ N$ A9 W, q* u2 K
- local j := loadLibrary(file);
3 J; n/ B0 |% v4 z2 L5 O7 n
$ _, r$ X8 ~; d, m- if j > 0 then
6 \+ ~7 {; P8 Q! R5 z - print getLoadedLibrary(j)," is loaded.";% Z3 ^' u0 I( C
- ( T& D9 E3 B8 {# Y
- r := callLibrary(j, "calcSin", PI/6);# Z9 ]" R$ |5 S* Y5 W( `0 g
- promptmessage(to_str("sin(PI/6) = ", r));
' @' |: w# h1 E s9 u! j - / N: o8 P4 H% x* X5 P
- local str:string;
& V$ y8 \3 x: X' G0 Z" g- u - str := "I'm OK!";
7 O4 f* X! ?+ X" _& r4 Z# w7 i) ? - str := callLibrary(j,"resetStr",str);
7 |! a& ~/ P9 T. J# L - promptmessage(str);
4 G6 E% J: U$ E -
- z( ^4 r: I6 k% I. V7 z, e - callLibrary(j, "listAccess", Tablefile);4 H7 `7 D$ Z2 y6 K( O! M
- ' j; G# A4 Y. w% { c
- print "Unloading: ", freeLibrary(j);+ C- z( e! N) R% b4 c+ `( q& L) C
- end;
" M9 B5 ]* V A - end;
$ N% m$ H% S! r9 p% a2 Y/ b
复制代码 |