- is
; s- U2 h) K6 {$ i/ y; l - r:real; file:string;
b/ L! q& a: T K! k - do- s" `& ~, z" C
- openConsole;
- @% N! y. R0 u) n
& V6 U3 C& o# E3 W- W- /*
- c- H7 g7 y/ y% F/ e3 Y - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",/ c+ e a: H2 T O, V0 _
- when is64BitApplication then 64 else 32,
0 p* M2 U" W8 |5 `3 F - "bit.dll");( Q0 B% L) \* O$ X7 o& _9 {( f
- */1 p6 ~8 ^* H, \- e0 I- v2 L
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
- P$ ]5 L. e0 H7 t9 a* u+ K4 p - local j := loadLibrary(file);
& I1 P" P% p3 ^# s v) A - * w( B/ [0 L' X
- if j > 0 then. J, W h) O# v- Z8 ?1 @4 d0 K
- print getLoadedLibrary(j)," is loaded.";
1 z d/ [) b* I - # k, ^ Q+ c5 q' u
- r := callLibrary(j, "calcSin", PI/6); ?1 l( s! |( z) Q# U, H) t
- promptmessage(to_str("sin(PI/6) = ", r));. ?* u4 P! W0 O
- 6 x: r& H& ?2 T6 s/ d
- local str:string;
3 L$ }6 _! n r5 Q5 e9 L - str := "I'm OK!";. s, H1 X' b0 b5 ]) z& K
- str := callLibrary(j,"resetStr",str);
0 h" |* n' J6 J' Y& R - promptmessage(str);/ u9 y6 q; ~. x% t
-
" W) |' A) v* F; _' i$ _* U4 [- {0 N - callLibrary(j, "listAccess", Tablefile);
* d0 z3 q1 O6 b' ]3 a -
+ F2 h6 E1 m8 w. G/ b - print "Unloading: ", freeLibrary(j);
! g4 L# S: T# k1 W1 S. L) o7 {2 m - end;
. ?" u9 t) N# |# ~) A4 X6 P* V; ` - end;
+ g0 m- K1 e. n; @* ^
复制代码 |