- is; _) c* ]0 j8 Q/ P
- r:real; file:string;
; G9 r7 r9 c2 {8 P+ p9 m3 [& V - do l% R) P: o' s5 l
- openConsole;
. v0 b1 i6 c4 ^. s
6 f* F! Q6 N: g7 @1 D, ]- /*
3 k0 i4 Z6 O, I1 N& p! T& w- P) P - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",3 A: X: B7 H9 c: Z5 v, w
- when is64BitApplication then 64 else 32,5 V0 z# l/ U, W- ~2 z: M& y
- "bit.dll");& g0 v7 t$ O& _ f) O
- */
9 D7 y6 _, v8 N# v5 U8 M - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
8 R" B0 ^" a5 ?+ Z/ } - local j := loadLibrary(file);
! I; @% t1 f. p7 k* p3 U
% \$ u8 X; @7 V1 Y- if j > 0 then' S6 Y, ^+ a; [8 h4 ^
- print getLoadedLibrary(j)," is loaded.";
. L4 Y3 x( o% E1 k' ?2 T o
$ h. P6 r4 I1 V' R- b0 n- r := callLibrary(j, "calcSin", PI/6);
" L. C; o i9 w$ a% s' A' o; R - promptmessage(to_str("sin(PI/6) = ", r));% T% u* }! O5 s5 [3 C
- 1 A+ _; R9 h) x) Z1 L$ b0 i- u* F; ~4 m5 Z
- local str:string;5 o6 W) C# J) w
- str := "I'm OK!";, r, G2 j2 G8 d F
- str := callLibrary(j,"resetStr",str);
) ]! r& p# g3 ~/ l1 h: Y3 `! D - promptmessage(str);, p& s1 S9 W* ? ^
-
# H; t; O6 ^" p0 X; i+ x - callLibrary(j, "listAccess", Tablefile);& j' {# v! u* R. c- c/ _. J, \" y
- " T4 u6 u+ w2 k' h: e7 e
- print "Unloading: ", freeLibrary(j);
) e9 S* l- f$ K; d% w( o* P) y - end;
3 f- y8 q2 a+ f7 P - end;
4 U6 f c9 E" U$ `" O
复制代码 |