- is
$ B/ W) E& u% V* T4 {( j - r:real; file:string;6 q h6 j. }: N4 ~4 l+ Z# y
- do
@, C7 A! ~. G - openConsole;% `# m* F( s& X4 ~
- : }6 a# Z4 X) z* m" ^( p
- /*
7 a0 { x% I. J& Q4 _+ J, s: V - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
9 G1 g# y5 g+ n7 Y: E& x - when is64BitApplication then 64 else 32,5 m' P& N# O8 g% N% i: O5 ~
- "bit.dll");
5 m; ?9 u' e1 g - */
! D- [- P" D4 ? - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
# L% l, k6 d! r - local j := loadLibrary(file);
/ `' R3 b! o9 x! D - 5 c3 v& h* }3 R" \' I, g
- if j > 0 then
" A9 }$ n7 [; z( e - print getLoadedLibrary(j)," is loaded.";* B& [7 P# K" Q; U+ `) S: |5 J e
- , Q$ A8 M* @8 ~) `1 v9 j
- r := callLibrary(j, "calcSin", PI/6);
0 d0 `' x. ^( t5 i v7 u# h& M% `1 C$ U - promptmessage(to_str("sin(PI/6) = ", r));
9 a: t8 g: p2 e. ?% K2 U# H* r* N -
' l4 B7 [/ j1 w: y - local str:string;2 w+ F/ L/ i0 l, b X+ q* M. k: ~3 W- T
- str := "I'm OK!";
$ w. w, R7 h; o6 R( M - str := callLibrary(j,"resetStr",str);( P2 G1 F! `7 F% U- G3 y) L
- promptmessage(str);/ j3 J' L. D( J0 K
-
8 @ f" H" l% v - callLibrary(j, "listAccess", Tablefile);
# U3 U" g$ |( t+ n# u - ( B- ~: c" g2 O
- print "Unloading: ", freeLibrary(j);6 F. m- Z+ C" @
- end;
1 Y9 l+ z3 b0 j4 x& g4 B2 f - end;! s* q2 Y" h" v7 q
复制代码 |