- is
+ O1 u, h: p. N" A( _3 v" T! g# E+ r - r:real; file:string;
; ^5 d9 e4 B2 I- A9 M - do
! m- Y" a/ R) V% z - openConsole;
9 l0 @8 r! B$ ~/ f- z8 Y7 @ - " |. u6 |( e( [2 C+ t0 S
- /*
: F8 l! z2 t: \: ] - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
5 D$ _8 ]: A- p! g. K - when is64BitApplication then 64 else 32,
( [: _6 z" \& u. T8 h X: O - "bit.dll");1 w+ p* D4 K/ A( r) m8 L
- */# T5 x* I& d% `! b% D2 |
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";# v$ _: d. q" g% s& c, G
- local j := loadLibrary(file);
: L! K: o1 V/ m7 C7 e/ r - + H% o8 ~' X! z- ^4 w+ R
- if j > 0 then& `0 a3 [! R0 K7 }; e: N
- print getLoadedLibrary(j)," is loaded.";* a6 }. t8 E3 U7 y4 h
/ Z' R6 j+ R3 D& i) S) `; B4 c- r := callLibrary(j, "calcSin", PI/6);
6 K8 s' h; T( {) S - promptmessage(to_str("sin(PI/6) = ", r));) @; C5 y0 ]3 j& l. P, v
- 0 h8 @( E# x- a8 b
- local str:string;
# s% K# Z" W; [! G - str := "I'm OK!";
. ]2 ?# p) b. \' D! i& g" r - str := callLibrary(j,"resetStr",str);* r- Z7 u( C6 H3 x
- promptmessage(str);
6 g( D, M6 Q6 x( M -
1 D. y; t5 c/ x - callLibrary(j, "listAccess", Tablefile);
' P7 W( X, I( ~/ z' n -
2 {& |; C+ [" z5 p! @ - print "Unloading: ", freeLibrary(j);1 i. I! S, g7 F' d: U, |
- end;
, @* N9 g _5 O+ y9 C& b - end;! r- J; h1 N p' Q* i
复制代码 |