- is
; T; Z$ y5 m8 Y( | - r:real; file:string;
& l, l# q/ Y: V. L! Q) p$ h - do
* q6 ]' x$ [9 g% c2 f - openConsole;
/ L7 g, v8 L; @3 J1 z- q* i1 w4 a( R
. s% F( Y. K$ }6 c- /*
% Y, v4 |, S2 K4 ~9 ]2 m: q9 K% ] - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
; A, W( Z# q! Q$ x/ ^" X - when is64BitApplication then 64 else 32,
6 j: A$ Z: n9 e, |# o. b+ S - "bit.dll");
6 T: Z y8 _) m ] - */: y! ]- e S# u% Z- F/ t/ v" p
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";8 R( j7 N' _. p0 F
- local j := loadLibrary(file);9 d8 J6 o0 w: I! Y% c2 T- C
$ ]) s) h2 e8 D2 @: o$ }/ [- if j > 0 then
/ W2 e9 l9 `8 ?0 d( j/ I% \ O9 f$ v - print getLoadedLibrary(j)," is loaded.";+ Y5 m- {9 n# i2 F( A/ b
) T8 f* u, o* a7 u) n" Y/ L- r := callLibrary(j, "calcSin", PI/6);* t8 g) @0 O4 w/ m+ w
- promptmessage(to_str("sin(PI/6) = ", r));8 c" Y' e) V4 N" |9 ^1 _
-
6 Y, ~# p, q/ a4 s - local str:string;
& h. X J4 l2 i4 ]& z - str := "I'm OK!";) `) l5 @" W+ ^+ J/ g( {
- str := callLibrary(j,"resetStr",str);! o& H# h; P+ B; Z6 g/ ^5 [, @
- promptmessage(str);# m! p) j. d4 a! N
- - M9 Z9 |( L) [5 i9 a
- callLibrary(j, "listAccess", Tablefile);
+ w4 Q- C* r% m -
8 f' v: P3 Q0 z) R! w @ - print "Unloading: ", freeLibrary(j);6 O1 i& X; ^+ a+ h& u5 D/ t
- end;
) R: e' x+ g2 d9 w' J - end;' Z. R' T9 @1 F6 w6 V
复制代码 |