- is
P" A1 q2 d. t! o7 p - r:real; file:string; t. Y' q8 }( a& y+ A+ [( f+ r
- do
7 `' K4 G, p- _$ j. J# l; ]1 f - openConsole;
8 t# o$ x* m1 I; ]; o
8 F C% z6 Z8 c! `5 O! P. I- /*
) O# b) C3 W9 Z: e5 e - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
9 B$ E3 Y% b9 G8 \8 j - when is64BitApplication then 64 else 32,
5 d, `, j! S6 `% M& @ - "bit.dll");1 M1 O3 w' R' c9 x5 W4 D# Y+ @
- */
, v" C. j* l/ T" p - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";3 E) y8 n5 U: y+ w- c% f M
- local j := loadLibrary(file);" i5 Q: e7 K/ t4 ^; M
- 3 h, j0 A! A1 ]5 W
- if j > 0 then
) Q) i, A2 M, E( ?) L! _ - print getLoadedLibrary(j)," is loaded."; S" |' _; V3 g _; z
- 7 x" ~1 r+ u9 h
- r := callLibrary(j, "calcSin", PI/6);! o; q5 i. r. P. @6 a# O* x
- promptmessage(to_str("sin(PI/6) = ", r));
% Z7 e* X' J. O -
d7 u9 A; ?; @. E- H, p( x - local str:string;' ^: q+ P. U) c' s
- str := "I'm OK!";! K* d0 U9 K- e9 e
- str := callLibrary(j,"resetStr",str);1 g, ~. Z/ e" h$ N
- promptmessage(str);
, }/ ]! L* M8 |8 ]! [5 b- K - 4 s O3 W P! d
- callLibrary(j, "listAccess", Tablefile);
0 V' ?+ ~- f5 R - ) G1 @5 z8 j% E
- print "Unloading: ", freeLibrary(j);: J! L/ v! v+ r A9 E2 U8 m
- end;! `0 [" |( G7 K5 G7 T0 p4 B
- end;# t U: _& {; G# n! c+ X% @
复制代码 |