- is
9 H7 q% f. D, x8 s O' W, O - r:real; file:string;3 J: e' N2 q/ s( D u6 [0 y
- do. w y$ b- ^9 D8 W7 k m) A
- openConsole;! E/ l: L2 u4 a. r2 e
. |2 @6 z2 r/ ^2 A; F- /*
; e% P( K7 P% [: A - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",1 S4 y% b' m0 c
- when is64BitApplication then 64 else 32,
- I" H4 D( S! a2 C9 E q3 f - "bit.dll");! W5 O" G. T! n2 q {, [ j
- */+ _, o! Y$ ?8 x+ v& S
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";$ t) y Z5 s5 d6 I9 Z* ^; d1 Z/ C
- local j := loadLibrary(file); a+ j- Y% W. r$ r- [4 Y
- # C' J* m7 K' T2 r0 X
- if j > 0 then
. n9 j1 W1 C* R2 U# S - print getLoadedLibrary(j)," is loaded.";. V! A2 _5 Y+ t- O ^' t8 Z
+ ~7 y6 m, g) k3 o) X3 ]9 \- r := callLibrary(j, "calcSin", PI/6);
3 z$ t" o8 \2 W$ R$ ? - promptmessage(to_str("sin(PI/6) = ", r));
5 I' e. k9 _( a1 n3 x+ A - , ~, S- Q: G D* t
- local str:string;1 F3 ^. t9 ~, t3 \1 ^, [7 T- |9 T
- str := "I'm OK!";
6 Y1 {, V$ q, r+ i+ H - str := callLibrary(j,"resetStr",str);
' Q( ^7 M1 J6 G$ N0 K. }1 j& y0 X+ ^ - promptmessage(str);
J6 U }; i" h$ U0 z$ F6 I1 t3 q9 o - 9 F2 h1 [& I" {/ T# A3 S
- callLibrary(j, "listAccess", Tablefile);6 a$ A% B& R J& G
-
' Y) K+ I& W6 ^3 B0 F - print "Unloading: ", freeLibrary(j);
) t0 A5 `2 S9 y4 E - end;6 |; x P) \, f- u
- end;
( A( h; B: m3 `* \. F% W
复制代码 |