- is2 L$ X0 D0 y- M
- r:real; file:string;
5 z. ~: U; k' Q) i0 A9 k - do
- \* i; ~" s! {5 I7 e) T3 f0 N - openConsole;
- F, B5 k6 x) |+ M& ~! I p
: z& h v- s2 U/ ^! K6 \- ]9 X- /*
1 g0 c7 \" C' Y - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
7 p' u3 \- Z# L( `6 H' `$ a0 f8 q# q - when is64BitApplication then 64 else 32,: |' `6 b+ V! S" k! X$ I* S
- "bit.dll");5 t% D" f/ @3 V" X
- */
1 ~& S% P4 I3 ]: }+ ^ - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
5 I1 M! y6 ?9 i! \ - local j := loadLibrary(file);
9 K, z2 W1 Y7 \! F. X! a( ^ - , P+ j- [7 Y2 }: K
- if j > 0 then
' r: \+ ]7 R) N/ ?0 @$ z - print getLoadedLibrary(j)," is loaded.";
7 C& n$ W ^7 y) x
* D j# P5 B y& c' |- r := callLibrary(j, "calcSin", PI/6);6 \ l( Y R! d
- promptmessage(to_str("sin(PI/6) = ", r));
H1 [8 p h3 k - 1 M, d1 w, `. y4 S" x
- local str:string;3 Q2 z' {9 O, y! p3 d: Q$ _, E
- str := "I'm OK!";2 m5 _$ c9 _* K/ c5 \; G% h. B
- str := callLibrary(j,"resetStr",str);# G) Q' d8 r1 n+ R
- promptmessage(str);
. I! K& r" L" k -
, {; ^& L; `/ @) a, o p - callLibrary(j, "listAccess", Tablefile);$ z% ]2 ]! {8 r e/ x ~( v- ?
- 9 J: {, ]6 f# q$ M
- print "Unloading: ", freeLibrary(j);! v. `6 [) P) {9 b. {$ R
- end;
/ ]4 }( A+ G0 a - end;
( K. M2 w$ ?* n* I
复制代码 |