- is
9 L( H$ ^, j* N - r:real; file:string;
6 b3 @1 z0 G j$ G: F - do
7 j. }/ \# f+ b - openConsole;
, |' q# N: s2 U, [; V" k5 G2 Z - 4 E5 k, u9 i N t+ U
- /*
" ?; }) K# O& ~1 [' y - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
, w$ _+ ]* _- b f- v - when is64BitApplication then 64 else 32,
, ]$ H- E( ?" Z) B - "bit.dll");) `+ Y) H. ~0 S
- */
) `/ {% U3 e! x/ }* b* L - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
- [2 Q# S. a8 O - local j := loadLibrary(file);
1 R7 q {+ e* J* M
' `8 ~( I+ P# y0 ^( q! t- if j > 0 then2 Y# Z0 x1 h# \7 w
- print getLoadedLibrary(j)," is loaded.";
4 R& Z. r& |6 [$ F$ P
( _. G q$ z# R7 \: M2 L- r := callLibrary(j, "calcSin", PI/6);" `8 @& W7 {9 O7 ~" s3 Q
- promptmessage(to_str("sin(PI/6) = ", r));6 ^/ Q2 Q4 x. [4 C0 t* @
- % n' K, | a) H! V1 C1 j! a0 u
- local str:string;
1 ~# y9 W+ S, D) ^ - str := "I'm OK!";
3 ]: h7 q% A* o& N% e$ l+ a0 R% i# y - str := callLibrary(j,"resetStr",str);
% W1 O" M9 U, w: V( k2 z0 n - promptmessage(str);
( x7 F) Q) U" c. W6 G -
4 ~- P- U3 y& @8 z$ u5 _ - callLibrary(j, "listAccess", Tablefile);
" r( U5 v0 Q8 N8 e+ A3 h - ; ^. z T1 H/ ?. d% v0 @
- print "Unloading: ", freeLibrary(j);
! A( @( {8 B4 `5 X - end;
; v+ O, B( @3 L. A. A4 C% _ - end;/ N) m7 I- {7 g, d0 W2 q4 t
复制代码 |