- is0 L2 L7 P! U. T( _
- r:real; file:string;
/ Z5 B/ b% a/ l7 X. q* u* z& D - do' ]' Y; r- l# m/ n
- openConsole;, M5 \& N$ o* W8 R% c
/ U* f4 q& y b3 ?) i- /*
& U- r# K( E' C/ E- d - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
: J' b( c5 q! [* G% Y" _ x - when is64BitApplication then 64 else 32,1 _# J' ?+ i* \
- "bit.dll");
5 M( ^5 l& _' E7 y - */
* S2 z, |. ^2 I% Y - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
; w4 L% ]( s6 R* S8 ~ - local j := loadLibrary(file);2 X6 I5 ]6 r7 n7 c4 r
" \+ |* s. C' w; K8 C- if j > 0 then
1 B: @( e! x9 g( m - print getLoadedLibrary(j)," is loaded.";. z# \- V1 K6 H6 _' g& Z: ~
) L" u) A* i, B' v0 L- r := callLibrary(j, "calcSin", PI/6);& J: p) I3 O$ k1 ]$ v' }; f# E
- promptmessage(to_str("sin(PI/6) = ", r));) v; L) [, J1 B2 t* e2 U
-
% P! a# a3 q4 ]$ n - local str:string; {8 C. x7 T0 y* m' W0 @
- str := "I'm OK!";
3 A* V+ {% X" j* p% D - str := callLibrary(j,"resetStr",str);9 K; H8 I, ?# f
- promptmessage(str);
. H2 s- Q' v, @( |! M -
, r0 h4 d) t4 e; [: @8 R9 ^ - callLibrary(j, "listAccess", Tablefile);
' P& Q( n4 G3 }3 p9 ^ U( c' C -
1 p0 p3 x: g( E; ]0 P - print "Unloading: ", freeLibrary(j);0 E) H: f! t. X
- end;
- o4 j0 p, B4 h0 ?, _9 H1 l - end;
Y$ @# M1 A# ^' r/ U
复制代码 |