- is
1 x) e7 ]1 k. p$ ~ - r:real; file:string;
$ V$ z7 S2 F% v1 H - do+ L7 u7 ^5 j; j+ s
- openConsole;9 r/ Y8 K3 `& m9 u* M0 {) r
- 0 Q" N+ M; D7 T% ]" m
- /*2 g9 l U' {" r7 p, g- _
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",! q* n. @0 ^ O( U& e
- when is64BitApplication then 64 else 32,
; |2 ^! D$ J. m, w4 u7 x4 U - "bit.dll");
( u4 n8 Z" R A: Z, W - */" p9 g: T6 Q* D7 |- _
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";& y3 H8 z5 T" O& A
- local j := loadLibrary(file);9 P) t. J5 v' f( Q+ Y
- / n# p1 L$ I) s5 o' l
- if j > 0 then
Y: f, n* @0 G B9 B# c - print getLoadedLibrary(j)," is loaded.";2 F1 j2 R: W; |6 C0 s* g/ }
, F: ^8 q& g0 K. ~- r := callLibrary(j, "calcSin", PI/6);
5 L: ]' k4 }/ l9 j6 t+ n4 z - promptmessage(to_str("sin(PI/6) = ", r));
( \6 ]; j; i% U1 \* G( ~ -
1 c% f- `4 r" \4 o4 h2 ] - local str:string;) m& h0 n' x8 [- u3 y
- str := "I'm OK!";3 D+ y- k+ D; S; ^
- str := callLibrary(j,"resetStr",str);/ D+ M8 r6 E+ ^+ Q: a
- promptmessage(str);" f# z6 C4 ^1 `3 P6 K+ c
-
/ C0 X8 O6 E/ u( F8 r" u - callLibrary(j, "listAccess", Tablefile);9 K' r. z8 T8 A) l0 b
- . V! s, w+ a$ _& m* F
- print "Unloading: ", freeLibrary(j);
2 g' e8 W! U+ S4 P( W { - end;3 u! x1 J, C5 L: `* _ `
- end;
; u( u5 c, T8 p3 v7 `3 |# p- Y: e& d
复制代码 |