- is
9 m' b+ I& y6 Y/ R& w, x6 J! X( ~ - r:real; file:string;
+ U3 [& l) P" A$ y - do
7 {) C; v7 P7 ]) F7 Y6 |! g - openConsole;0 H3 \3 P2 ~8 j* Q# a" X5 A5 l
- - f+ F& p2 s9 P; ]2 r8 A
- /*
1 a1 |* w/ ^8 X5 B6 s' j4 h5 z - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",( b- C% G) v- G) {
- when is64BitApplication then 64 else 32,4 Y+ b% y5 g) v8 d* Q0 W
- "bit.dll");
) Z/ d4 T$ s3 e2 q - */
5 R2 D! Z6 W; U m2 b - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";, H( t* P& v& U% q( T9 k
- local j := loadLibrary(file);- i1 z5 Q& B! p- S" N# F
- ' b5 H: b# [/ t, r, Y
- if j > 0 then6 G0 d0 b$ w6 W' I" Y [
- print getLoadedLibrary(j)," is loaded.";, @" w( ]3 i. { ]/ [9 i+ }9 q. ~! }
- & }! `( k9 V% x( Y
- r := callLibrary(j, "calcSin", PI/6);1 V# N1 h4 ?! Y, O) S* W
- promptmessage(to_str("sin(PI/6) = ", r));% u5 v! a4 t! _( A
-
/ B1 j$ c- X* c2 E7 m - local str:string;) j0 x* ?; d! Z, D6 \5 {# H; N- O
- str := "I'm OK!";
( e& a6 x+ i/ W: R! ]) i" ~ k' v+ y - str := callLibrary(j,"resetStr",str);
5 s8 ~" B+ B$ ^) n3 } - promptmessage(str);* n% A; i, o2 c0 I
-
7 Y+ N( a4 m" K; @- d - callLibrary(j, "listAccess", Tablefile);
5 W" D. ~( x" ]' n4 \ - 8 d' x; `4 Z6 b9 `- K; T
- print "Unloading: ", freeLibrary(j);8 I% h+ A4 B2 A, Z. u
- end;( Y7 t# f9 n, q4 h: d
- end;
# W3 n4 I. x+ ?* O% k
复制代码 |