- is
Y4 }4 Z( K, t% T' O2 M9 s; ~ - r:real; file:string;
4 S( j) c3 q7 t7 R, G" M4 U - do
1 Z% W- V! c8 j w, r - openConsole;
' N( j. _( t& A& L. w
- F% Y4 {2 S" f+ z" Z: S6 Z5 |6 A- /*
7 F; b% h( b4 D# a& U - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
! b2 r9 Z8 s$ i7 {! A( e - when is64BitApplication then 64 else 32,& r3 p$ K6 Y2 I$ ]: Q) ~% W
- "bit.dll");
+ w$ W* H( ^0 Y# W" } - */0 R8 L+ w' h& i4 H; ?
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";1 r: G/ m R" e0 l7 u
- local j := loadLibrary(file);; L s- ~; B5 Z3 _) t7 h X) w( X
- $ L" U# v$ o, K# L1 l% }2 J
- if j > 0 then7 J1 h/ Q% B5 s [: X8 |& a. V2 S
- print getLoadedLibrary(j)," is loaded.";
# ~( v# S/ M4 U& M
" W" `! `) P5 x7 l! n' g# h- r := callLibrary(j, "calcSin", PI/6);, \, V3 d, i5 _! A1 k
- promptmessage(to_str("sin(PI/6) = ", r));6 t4 F" l, J7 u; @
-
* ~5 U* n7 i4 \+ l2 D$ x - local str:string;5 g; Z% s4 w% g2 _# o$ T) L, ~
- str := "I'm OK!";/ n% @# w* p1 C6 T" V$ s# i
- str := callLibrary(j,"resetStr",str);% H2 m, s8 E, b: A3 l, Y; Y
- promptmessage(str);
4 t7 K, ~4 ]* ~/ v3 I -
' b4 a# Q; E0 x& f5 y+ q0 H* z - callLibrary(j, "listAccess", Tablefile);
5 K# Z) ^' s+ R - / B; Q- E5 f4 i7 {" l8 T# p
- print "Unloading: ", freeLibrary(j);
+ w% p: U* g; C1 S5 X - end;( {3 v: b0 X3 k: @% c
- end;% e8 R' ~) l& c) H% c3 C
复制代码 |