- is
" r) e2 m- o5 K. f Y6 P/ E$ o& y - r:real; file:string;' Y5 q+ a" F" G# m0 J4 A3 X
- do
5 l* x& @' g% x# T0 D$ r- m# F - openConsole;# D* e" P! l4 J5 h1 e0 O
0 B4 k# C$ F- u' z- /*
7 D3 M7 p# d+ G - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
$ f, E1 x2 [1 ]4 |' c9 U - when is64BitApplication then 64 else 32,
& g+ E) R- @ r3 J8 f - "bit.dll");
7 q" Q7 }" W) [ - */
7 d! ~) K6 j. r4 ~ - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
! t3 O9 J5 @/ w9 V6 ` - local j := loadLibrary(file);
( T, Y4 Q, V, s! u; v' i
) H |; O8 p2 _+ s- if j > 0 then/ G9 o0 B! t- F3 W
- print getLoadedLibrary(j)," is loaded.";1 N6 R5 t& m0 r. s! k
' N! D- b. F8 q( ^& D0 _- r := callLibrary(j, "calcSin", PI/6);7 c) l1 j D0 E. S4 R- ?" Z" Y& U2 X
- promptmessage(to_str("sin(PI/6) = ", r));
0 p1 x! O* Y! W1 g8 x, R! {" | -
2 s: m7 F% b M6 @6 F4 d: h9 ^ - local str:string;
/ u, e; O+ q/ W/ _+ j. q - str := "I'm OK!";- D0 U, [& Z. X# d
- str := callLibrary(j,"resetStr",str);
O# M* A1 T. N - promptmessage(str);
$ A% f! F2 N1 I( x! k) L - : ]- ~" _- H! c- b
- callLibrary(j, "listAccess", Tablefile);1 Y4 h* W( p) r- a% M. {- |
-
' d: g# C2 m! m% c0 X - print "Unloading: ", freeLibrary(j);+ g" f; e- S% y& I
- end;5 y' P' v, c- O3 [' z
- end;
. |4 k& }( s" @- w6 o
复制代码 |