- is
7 J4 i; Q* G8 @" Q' }# e/ j& d- _, Y - r:real; file:string;
9 {' W; ^8 @& D. Y0 M+ J - do1 ]; P& V: O! O& Y ~5 v
- openConsole;
+ b5 Z" o. k: q4 V - . h) Z! N! @: J& ~1 ^4 z
- /*2 r1 m$ Z$ ]# m4 @; G
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",' [7 T& E/ R" Y4 k" p, n1 b
- when is64BitApplication then 64 else 32,
, P3 E- @" g) _3 \! S, M+ n1 Q - "bit.dll");
( @( g! a& l a b7 r - */
' N4 F7 b T- w- t) Z! z4 m- f) z* G - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";' L7 P" p; s9 g& U- V
- local j := loadLibrary(file);
$ i$ X# Y E& W4 y6 b0 r
% z6 Q7 \9 m; d" U: x1 b N) F- if j > 0 then! P( }( h I1 Z" C# s
- print getLoadedLibrary(j)," is loaded."; Y' Z: S6 C4 |, `! N& g
- / g. P+ @ p; E) i
- r := callLibrary(j, "calcSin", PI/6);
8 Z" X8 T+ m; V8 J - promptmessage(to_str("sin(PI/6) = ", r));! @! Z) T( ^* h$ k
-
2 P3 y7 \6 S& H' `& x9 F - local str:string;
! D' Y+ r- v" w8 i2 M! k' m - str := "I'm OK!";
; _0 |* q, _6 f0 w; o% A - str := callLibrary(j,"resetStr",str);4 c7 a: x" a, `4 x- c
- promptmessage(str);
* n; S4 K5 U% n( A -
/ s& x' Y' |. W, a" d+ _ - callLibrary(j, "listAccess", Tablefile);1 V; `! V0 y$ M9 y1 s5 z9 I
-
6 j6 @. @/ N: H- y* ` - print "Unloading: ", freeLibrary(j);+ V; m% S6 Q- q2 N
- end;
# y6 X& \" D3 t; l7 T a - end;
- g2 F8 I! E" e! e/ _
复制代码 |