- is
9 P; H7 }1 Q& S$ o2 ^; E - r:real; file:string;& p4 V* Y: e. Q; a* g4 s8 x/ T7 M
- do+ G a) v4 V5 o' ]/ q7 s& W
- openConsole;9 x# |' ^2 b5 i+ m9 d% F
- % x8 Q/ |) D/ D- X2 ^. p
- /*
. m: L' b' P2 s* i8 h - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",& }8 o$ G6 b4 Q. t) `
- when is64BitApplication then 64 else 32,# X7 J& w+ J9 k# |7 W4 U! |; y
- "bit.dll");: b4 B8 _7 F) L8 w( b9 T. P& ] h
- */5 H' _% m7 d2 _+ E" f
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
# S8 a7 z2 K9 O! w* M# | - local j := loadLibrary(file);$ Z" V3 f; S9 x. F/ x" I
- : r8 x6 Q! Z$ X5 _" k1 G0 R0 v- `
- if j > 0 then8 b r; J. _1 h- p7 Q
- print getLoadedLibrary(j)," is loaded.";& e# `& x" T k
+ _6 J% L2 p6 |7 N- r := callLibrary(j, "calcSin", PI/6);# U# b+ x- L c) I( I* J( d. L5 N
- promptmessage(to_str("sin(PI/6) = ", r));
u: f& U, d' Z5 {( U5 B2 F - ' K, z. Q% k; x
- local str:string;: J; a$ }8 B2 R, G* z/ M- G8 D
- str := "I'm OK!";4 w8 U7 _, Z1 j. [6 t9 h9 K: z8 ~+ B
- str := callLibrary(j,"resetStr",str);
& s; ?7 o/ P) S/ ~7 } - promptmessage(str);2 {9 |0 O2 M$ E- R- p
-
5 X7 E' [* S8 s - callLibrary(j, "listAccess", Tablefile);$ Q, X; m# g2 X) E# L' k
- . Z6 J5 x* z7 H" q/ P/ c F* b
- print "Unloading: ", freeLibrary(j);
9 R" Q4 r1 k+ P: \) F. C' \: d - end;1 ^9 W8 B* O/ t( N
- end;
: V6 b- \2 y0 Q) A$ b7 F7 O4 W( o
复制代码 |