- is
* }( a8 h% H* D! \/ x& c! g; v( `) L - r:real; file:string;# H, \6 F( f1 v ]
- do
0 L" k* }" X. L7 [ - openConsole;
' O: z" T" Q m
! k% @( C* h) @7 M: f- /*' M3 z3 P: K# K' R
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
, Z! s5 Q+ I A$ o" a3 Z( I1 G - when is64BitApplication then 64 else 32,
' ]9 q$ |' }4 J! A2 B - "bit.dll");" {: y+ n# t5 h5 v) s9 u* I4 b5 O
- */
* V4 W0 z# B, U4 u" P5 M - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";- r8 M# Y7 b4 {
- local j := loadLibrary(file);
* J% ~3 g- C1 a - * Q: l& e# L2 a* p; L5 N
- if j > 0 then
4 i) ^. d7 G* A7 j1 `4 _ - print getLoadedLibrary(j)," is loaded.";
( N& L) o0 R! d
1 }$ k4 E4 {8 p4 b) v- r := callLibrary(j, "calcSin", PI/6);
7 r# R8 ~) ^3 c0 z - promptmessage(to_str("sin(PI/6) = ", r));$ a) p) m4 F" v9 g$ m
-
; D! i/ q- J5 i% j - local str:string;0 V/ h% u, c3 X4 [! |
- str := "I'm OK!";
4 ?* N7 @/ w6 y7 J - str := callLibrary(j,"resetStr",str);
- S. |8 s; y# d' c k* q - promptmessage(str);3 M$ ~2 P0 P5 }& |: F& @
- ) f L) E- B8 X5 }2 x8 ]4 F) C$ N
- callLibrary(j, "listAccess", Tablefile);- \ Q* Q* ]: A7 l- B+ q) R+ b7 d
-
! |4 ?" V* U' a3 J7 U! L - print "Unloading: ", freeLibrary(j);3 l) L8 R. A2 |, y
- end;
" y, G8 x& z# r - end;7 q7 M& l. p$ {0 ?
复制代码 |