- is2 T- y6 b/ r/ F( x
- r:real; file:string;
0 ~1 p- Q- r/ y' u, u. [ - do+ k; Q8 a2 b/ Y% f& D4 P: L |
- openConsole;
7 s& L/ S. A* H h1 d" z1 u) } - $ M9 h6 J8 ]" |! p
- /*
, N! ]6 v$ @( h( F- F% G/ S1 x" O - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",4 j; P3 M6 `8 D/ j% }: v
- when is64BitApplication then 64 else 32,- k, P5 p e: y4 B9 e/ O3 Y- P
- "bit.dll");
5 }; i+ ~" O' K+ P% I - */
" q6 v: w4 x' |9 d+ o - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
( [$ R+ O- }9 T5 M - local j := loadLibrary(file);
# @2 ]1 C* K; G( R - 8 w) {# p3 ?' M4 H
- if j > 0 then
% @6 L" ^3 I5 T! S( c' ] - print getLoadedLibrary(j)," is loaded.";
4 B# A) F5 T) j6 i
0 {0 u3 k6 ~' p% n; m- r := callLibrary(j, "calcSin", PI/6);
, Z" K2 i( _/ D' F% z - promptmessage(to_str("sin(PI/6) = ", r));0 t! w6 ?: b" E. z
-
4 N* |+ w4 U7 r( v4 [. ] - local str:string;
1 b; q! i( `# q% }# O. C - str := "I'm OK!";
, M( X( J+ W0 r' o8 Q3 i3 p - str := callLibrary(j,"resetStr",str);
: X/ i( l1 P Y8 V) a - promptmessage(str);
7 p. b3 d& ?0 M) p( ~ - / K( L+ ^* ?8 @8 H8 n
- callLibrary(j, "listAccess", Tablefile);9 ?/ e+ n' N. u, T; R) h9 y
-
5 S* @- G7 t5 N- g7 I9 U' ? - print "Unloading: ", freeLibrary(j);. x. j; c) {* a; J
- end;
x. K% j. ?: y9 y$ N' X8 R6 { - end;* z. h; T9 r- k( n0 ~
复制代码 |