- is2 t3 W K2 l; K0 x s
- r:real; file:string;
, s+ C& ]& t% I7 \. v* y: r - do
( Y* }" a; [& `, n - openConsole;4 [+ Q, U, B* x8 @: K# X
- ' b1 p! |/ [- \4 |8 s# m" d# L3 o( L
- /*
& u* y8 g) l4 [: A" N - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
+ N7 T. V v& g8 U& _- K9 {) y - when is64BitApplication then 64 else 32,8 E; M- S1 F% ]
- "bit.dll");0 \* X! n" m2 x& i& i2 N/ Z
- */
% y; D; r! E7 ]4 Y& H2 ?9 h) U - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";2 z+ Q* ^& |) h4 n; J% K! J
- local j := loadLibrary(file);
( m8 x5 s* l, B+ @3 d4 k
- q0 F3 B3 @/ o6 X. J8 @- if j > 0 then
. x2 R7 \. c! q. R - print getLoadedLibrary(j)," is loaded.";
2 S. t! M h4 Y) Q - ' _7 w# ^% q" J- l3 |- U3 C+ O- f8 d
- r := callLibrary(j, "calcSin", PI/6);2 H0 r6 y' o ?; `. O6 \* ^
- promptmessage(to_str("sin(PI/6) = ", r));
, Q% A# W% W2 \% _4 Q/ z* S - 7 e' i# c4 z8 D# W' n x; i- u }
- local str:string;
0 ^% z4 ]. j9 d/ |; f8 c8 h, l) h - str := "I'm OK!";" g. N3 G# a& U- G$ ^& i% t2 A
- str := callLibrary(j,"resetStr",str);
3 l2 e: l6 r4 `6 m* Z8 _ - promptmessage(str); z8 @) h6 x3 S* y" r2 y
-
4 P9 Z8 ` G4 E; q5 N - callLibrary(j, "listAccess", Tablefile); e, C0 n- g7 m# H5 d. P3 H# ]
-
# F% z' s0 p( |- E1 m7 L7 {% b - print "Unloading: ", freeLibrary(j);
$ E" K6 z, H' E7 J - end;
' _, s0 r" S" w+ o. o% ^( A7 ^ - end;
+ x" P8 Z1 b' e9 a( H! [
复制代码 |