- is" {0 v: A6 g: w( x" b, t
- r:real; file:string;
& A" G: }" W4 W# }' c1 @ - do
8 z$ g W( Q% F% C6 o- J - openConsole;; S) ?" c4 ^4 {7 s. W* ~' D" x. P
- 7 ^3 Q- \/ E+ V4 v* W. z4 c
- /*
; n5 M) Z9 u0 T& R, P - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",/ n: ^: C% a. g% i
- when is64BitApplication then 64 else 32,# X7 C" x- P, w. Q9 @( f: s' u
- "bit.dll");1 R; L& ]1 e4 n# _- C
- */7 |# A& e' v1 m
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";% I* K. m) _+ {; Y
- local j := loadLibrary(file);- S" b* o$ U$ {( ]
( D1 W9 o8 d. Z3 P! m/ H- if j > 0 then
8 x- d* g# Q$ ?& r+ }& Y - print getLoadedLibrary(j)," is loaded.";
7 F% n1 z7 Y F I3 A - 1 m$ W2 Y2 |/ |
- r := callLibrary(j, "calcSin", PI/6);
+ l/ X7 m9 H' I6 _, f6 W$ ] - promptmessage(to_str("sin(PI/6) = ", r));9 {0 g( e: I' b4 l) f% C
-
( J S$ {4 C& k* D- D Y- L: K - local str:string;4 D* Y3 u: A, o! I+ p9 B F
- str := "I'm OK!";
) L: x# Y4 U$ D9 G- m - str := callLibrary(j,"resetStr",str);
* b- X% W' C# R' g - promptmessage(str);" A& K8 _& s: q2 x/ L0 z2 n
-
6 y. {9 Q. a% ]( T$ F( C* A. ^$ x8 B3 m - callLibrary(j, "listAccess", Tablefile);9 t3 {$ c' J$ y0 S7 k
- ) h$ G) X m0 M) k% r
- print "Unloading: ", freeLibrary(j);2 q S& a% H( R5 w5 ~ C+ y
- end;
7 C4 l: b( v" f5 ]! i - end;, p4 d' n7 U3 f3 R! A
复制代码 |