- is
5 g1 j m3 V6 u2 o" i# W7 m - r:real; file:string;" P6 q& J: p; O q
- do
; J- B1 @$ e2 | - openConsole;
9 {8 o% c2 O* m- N - 0 @* v8 ]5 E: K$ R2 l
- /*
" `1 T7 n4 i9 ~0 V$ J4 m. G - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",, m9 b- J# @* N0 S' p
- when is64BitApplication then 64 else 32,8 i! S2 L P& } k- H) c1 {$ G
- "bit.dll");
/ V \" ?7 R; C! N2 y5 _" u" W6 C - */2 u1 Z4 c4 W" w. a8 V
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";( e! c" p4 O, Q5 e l
- local j := loadLibrary(file);0 ]5 J" w( E+ R; F7 x, C; e: l
$ f. {2 f9 c: _4 H- if j > 0 then
4 B: l2 v6 |# K g! B - print getLoadedLibrary(j)," is loaded.";- H& g0 U6 G) }8 u
. |+ w- j% K& B- J9 q2 `7 y5 R" F- r := callLibrary(j, "calcSin", PI/6);. u# Y: L- _# w, L8 F- ]: I8 D
- promptmessage(to_str("sin(PI/6) = ", r));
5 W9 g9 h" @& ?2 T3 L6 l; S9 s3 L -
0 E- f2 r3 i, g; T$ Y* Z& l* q - local str:string;
+ W! g4 C0 p5 P - str := "I'm OK!";' D1 s l+ x) U& l+ e
- str := callLibrary(j,"resetStr",str);" Y' i, ^. E) M) G0 a
- promptmessage(str);
5 C6 R0 R! D& F( V - - Q4 E1 v0 ^, j9 M: n( h
- callLibrary(j, "listAccess", Tablefile);
1 i' _8 e1 i, j6 c+ Z+ p2 y% @2 w- T - & T$ x. A! R* I1 ]# I
- print "Unloading: ", freeLibrary(j);
; O- {) Y7 q4 o1 L1 ~( Z3 R - end;8 R! V( P$ X# G; K1 G
- end;' b6 h6 b/ l, e
复制代码 |