- is
& Z, s }: [4 J0 S/ ] - r:real; file:string;" |/ Y+ G, r+ b3 D) m$ `
- do: I: g3 @' w- F2 h
- openConsole;8 e9 B( M% f8 j- X; ?1 _4 R, Y
+ V9 `) a3 i/ a' P8 y- /*/ M q# ?5 J- {6 m
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
! f. o3 \' }7 a& ~/ Y2 L2 W) _# k - when is64BitApplication then 64 else 32,. D ^# H6 Q; n% m
- "bit.dll");6 N, H' l d( y! ]9 D+ M
- */
% s; J5 p4 C. q5 }3 I - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";+ n+ h+ Z) Q+ ~' S- |: p/ s0 }
- local j := loadLibrary(file);
r: K0 Q9 r+ K0 X$ U; U8 j
2 ]2 p6 T) ~6 @# Q2 j- if j > 0 then
/ F: w; x W/ z8 W8 K# o) S' T - print getLoadedLibrary(j)," is loaded.";
1 B9 o3 R9 W* u# s, l7 L - 2 @, \( H+ e% U) J) q$ z$ |
- r := callLibrary(j, "calcSin", PI/6);
: x( T! O$ ~2 ]# F" ^ - promptmessage(to_str("sin(PI/6) = ", r));
- T: \$ H c$ x- I7 B - 1 C% W: x/ X9 A7 I3 N+ G
- local str:string;
2 d& I, D7 W2 a: I* [4 z. R - str := "I'm OK!";, Q# `: W* |! S* b
- str := callLibrary(j,"resetStr",str);% W! h( e7 h6 j8 _
- promptmessage(str);( v' W. V* z- v; T
-
$ D! K' M0 r8 ? s0 k3 z6 l, l - callLibrary(j, "listAccess", Tablefile);
& E! F+ Y: v3 @& { - 0 x- `) h, {$ v! H
- print "Unloading: ", freeLibrary(j);
" x c w. k% B - end;
" n- r) d. N- o0 r7 u - end;
4 o( k+ @' L$ h. H) g
复制代码 |