- is/ ?! l; y+ T, z4 K7 k- e
- r:real; file:string;: j$ [/ a& L3 @4 Z% p3 G. c
- do
6 m/ T# v4 ] p! \0 z - openConsole;1 ]& _- W9 d6 z+ M
- 4 B# u+ x! F+ D7 V$ v4 e% O' W8 \) z
- /*9 j) b% L) l# r& R2 D$ R. i
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
! i, O/ u8 d, D+ n+ T- ~9 o - when is64BitApplication then 64 else 32,
' G- A2 t1 V9 O L' {+ H, |$ E - "bit.dll");, N, H4 n3 |- ] ~* o1 x5 R7 E C K- n
- */
% h" ^/ A, b8 [" C; L - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";2 z& p O0 e& V' v# R/ |
- local j := loadLibrary(file);
* ?% H9 [( }! T2 p+ r6 c, M. n
% S) i9 r# P3 b/ o- if j > 0 then
* o5 {; T+ x6 e8 G9 z - print getLoadedLibrary(j)," is loaded.";$ @6 d& D% k% `% d" ~
- 1 f0 C/ Z' P3 X
- r := callLibrary(j, "calcSin", PI/6);2 M- C# ?$ @7 x1 l
- promptmessage(to_str("sin(PI/6) = ", r));) W. ~! T" d" }: V
- % d- U+ k! D( @$ K i o! ?; V
- local str:string; |8 {: @) ?$ T4 O- b
- str := "I'm OK!";
4 X+ }. O) v0 o P( L; F% l9 D - str := callLibrary(j,"resetStr",str);
. ?' A) k! Q; r7 y* U* A) h9 ` - promptmessage(str);. p) m& I, v# g7 w5 e' g
- + Q6 g. P+ T# B, i+ V( @
- callLibrary(j, "listAccess", Tablefile);
) ^1 `0 E) K+ U/ x, X* |1 m: n -
* j: D) ?9 ]$ F! z8 g - print "Unloading: ", freeLibrary(j);1 b0 m+ [8 c: w2 d# a
- end;/ d& a5 \0 Y1 q8 ^; Q8 r
- end;
g' R* \6 a% U
复制代码 |