- is
" y8 Q* H& d y, e: j - r:real; file:string;
7 g/ G# Y2 H# F+ \ - do
& C5 W$ M: I5 q5 S# w: R `" c - openConsole;
0 c, K; {" |" U) [8 q+ J* [
. C* K1 G+ N# k) J% d, u! W6 H8 H- /* I! @$ j' `5 \$ S
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",) C+ l0 g+ N5 k5 z0 i4 |
- when is64BitApplication then 64 else 32,
$ w" Y: m' n+ N1 R" e - "bit.dll");7 W9 T3 S! \! |# i2 P
- */
$ r- Q4 @& ~* J - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
8 a! e& j' d7 G/ Y8 q& W0 c - local j := loadLibrary(file);
4 z. Y/ K4 Z! c
" z$ U5 D9 F5 @0 X- if j > 0 then
$ i4 o' ?5 K4 u/ S; j, K - print getLoadedLibrary(j)," is loaded.";
/ O+ d1 d/ E. V% A - ( m% |$ T1 `8 U( o
- r := callLibrary(j, "calcSin", PI/6);
, P( s: C! C( R0 R - promptmessage(to_str("sin(PI/6) = ", r));! ] T& c/ g: T" J" R8 L8 l
-
9 O$ s' r+ U! Z - local str:string;
9 h. ^4 ?) @ @: }: R - str := "I'm OK!";0 u6 U; x1 z+ q6 w" D {$ N& j
- str := callLibrary(j,"resetStr",str);
$ i3 ] R6 Z/ E: w. p' T' C$ B* ]3 Z - promptmessage(str);
( z& X( e- `) D3 E/ l -
" z% Y2 t8 l7 l - callLibrary(j, "listAccess", Tablefile);# ^+ S; a( d2 k- ~5 i
-
& b, b$ J1 C& c& A3 w- ? - print "Unloading: ", freeLibrary(j);
4 E4 f) M2 y3 E& f& D+ a - end;
/ F' m0 U+ B. \5 N3 e - end;
! e) j0 i& ^9 D, ]
复制代码 |