- is. ~; B4 L$ |: \& @( \' t
- r:real; file:string;
7 d9 g+ u3 r- r - do8 T, J+ l9 }0 M/ x
- openConsole;. ]! f2 ^& b+ b: Y( M+ n
- : }( R, `) V3 X( P. T J
- /*! T0 N9 b" K& r0 f4 a
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
. n% z! q2 i% r: p, y! j, u8 c: j - when is64BitApplication then 64 else 32,
6 ~4 ]( H) ^0 j' J+ I2 T5 [ - "bit.dll");0 q" m: K8 R$ c" L3 @$ ^; b" y) I. E, k
- */
' _9 ~: l! g8 }/ d" I5 M& I - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
$ ^, a! ~$ K. ]- B) o# E - local j := loadLibrary(file);7 W, N" ]" m) r- a8 i; E) ]
; g8 r1 {$ w" w A/ T# D- if j > 0 then+ `9 h. ?2 i q9 ]
- print getLoadedLibrary(j)," is loaded.";5 K- Y. M2 I& P6 j, o5 X
- 9 o7 ?1 M/ r- ~' ^7 S
- r := callLibrary(j, "calcSin", PI/6);
( u/ X8 c8 }1 l r - promptmessage(to_str("sin(PI/6) = ", r));
0 K! x# ?/ z' H2 w* B7 W - q$ k0 E6 Q( K) t7 N
- local str:string;
. H/ c; }) o; v) h- H7 q - str := "I'm OK!";
3 L, T; Q6 C. Q1 v5 w$ n - str := callLibrary(j,"resetStr",str);- C/ V$ {* y: X4 G( y
- promptmessage(str);* a( e7 W6 J( g: i
-
4 W' o) u* P0 X5 i7 ` - callLibrary(j, "listAccess", Tablefile);
, P2 {' Q1 d% e, p. m -
% m4 ~+ f7 q' {( i" s - print "Unloading: ", freeLibrary(j);1 _6 W. F: U5 V' k/ ]; B
- end;
1 B1 K' m+ G0 J9 N) X, e! o" n1 w - end;
. F6 ?+ x1 }8 Y% o
复制代码 |