- is8 {) j$ ^1 L2 O, k
- r:real; file:string;4 `3 p' _+ |+ J) S H4 b
- do* B+ b6 \& t+ G9 D1 b3 t: u4 Z
- openConsole;
6 H/ g3 n* {- H/ ~, U! k
% e; i3 @" h% d- /* N' u7 C. @& X, u! _% L6 k: R$ Y
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",1 h$ N. E/ C4 `, J! g- c8 p& `% [
- when is64BitApplication then 64 else 32,
1 s, @) V1 G, B* B3 E - "bit.dll");
- j7 A7 Y" _; M- `& w. E - */8 I$ n+ E: q/ b: U& ^
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";- q6 @" y, H5 l3 v# ~: ~
- local j := loadLibrary(file);
4 k1 K9 Z( w4 z7 s" a" W0 j$ Y
: w% U% b0 U. Y1 F2 c- if j > 0 then
% l V2 k- @; X* `' [5 h - print getLoadedLibrary(j)," is loaded.";5 R) X, N8 O, j
+ {$ d4 a! Z k# d5 M% j F- r := callLibrary(j, "calcSin", PI/6);4 I5 ]6 x6 T3 ?: D" `$ g
- promptmessage(to_str("sin(PI/6) = ", r));
}% [, k& W) e2 S: } -
# X1 m& J, ]7 f5 r' a9 a: t) @6 N - local str:string;
5 h g G( z: Y5 ~8 ^5 w) E+ g! o - str := "I'm OK!";+ B+ ~1 ^* A b# ~" S5 T
- str := callLibrary(j,"resetStr",str);
- }! D$ E: x1 z# e! \% L$ B$ Q - promptmessage(str);
: X, w8 p, t; h6 z. f8 U6 H% W+ l% Z7 c -
0 ?+ l2 [5 Z+ _6 Y5 S4 b* n - callLibrary(j, "listAccess", Tablefile);
; o. B9 Y5 o- s3 t6 f - f1 H/ V; ~/ s. k' N2 R2 S
- print "Unloading: ", freeLibrary(j);
7 \ p: }3 F( G2 u - end;
+ [! o: x- W2 g - end;
9 \- l. u" v! T% `
复制代码 |