- is
! n$ f* y/ G( a( Y; h5 ] - r:real; file:string;' O* i: w" B s" R
- do4 _; Y5 M( \" f" D5 F
- openConsole;0 u. }6 j/ D' ] a# N; v3 P2 g
( Y7 P) x1 u f0 w3 |8 D/ U- W- /*
, y9 K* D$ {# k; D1 P0 c - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
& I- ^8 C+ c2 X+ I: V - when is64BitApplication then 64 else 32,
7 D4 ~% E# r" L7 J - "bit.dll");
9 b6 `( Y" P0 U4 G& {) a - */
* s7 u% K; _' s4 @ - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";- J0 R' t: h$ c% B
- local j := loadLibrary(file);8 S E( [# E- r/ j
- ( d& Y2 v: T2 X& ]8 a) X
- if j > 0 then I0 O, O' w. s2 r# T7 g$ f g
- print getLoadedLibrary(j)," is loaded.";
$ m8 ]: L; f- W5 L: S$ @1 ], `1 O - % w. Y# d+ D f- p! E8 o
- r := callLibrary(j, "calcSin", PI/6);* A) f+ Q! w# k/ j. C# h. C. q
- promptmessage(to_str("sin(PI/6) = ", r));
( h# {5 Z: r8 K1 R" e. u/ n7 ~ -
4 m/ c. [* O4 Q9 T0 \' z$ d5 }9 r6 } - local str:string;
4 P; h" w K- P& { - str := "I'm OK!";4 ~8 I4 I6 R4 o9 V Y# s; |
- str := callLibrary(j,"resetStr",str);
& n, h, ?4 @. ? - promptmessage(str);. b/ P- z$ @ q9 L% C3 ], w
- # N" j% ~9 ?! o( {0 C( e& ?
- callLibrary(j, "listAccess", Tablefile);' [4 N# V8 O% E
-
% _# r8 M& e4 X4 A - print "Unloading: ", freeLibrary(j);: w4 m |5 V* D [- X) k
- end;6 X8 n" z! t/ \5 b9 ^" }( m
- end;7 {/ T. L) z" B5 P; A
复制代码 |