- is9 M3 o% g7 M; M0 B8 L
- r:real; file:string;! y* e5 P3 H5 E; f- s4 B
- do
! Q1 f: w: u" Q8 h" Z - openConsole;' H3 Z# e& _+ g0 I
- # ~4 r* N/ S' u* ^- Q C7 }
- /*& }" E- R2 C$ Y; w: j+ K
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",2 ]' R3 L1 Y" S9 w( A# v) t
- when is64BitApplication then 64 else 32,4 _$ E7 d Q' c4 H5 @/ X
- "bit.dll");
' M: \# S) _+ Z - */
% i, [$ Z9 O6 b0 N - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";- y. Y! j- [2 _; D9 G
- local j := loadLibrary(file);7 m0 f) O. l/ F3 r. a
- & D! }& ^8 F& }
- if j > 0 then6 Y; w% V3 _$ O# d" Y
- print getLoadedLibrary(j)," is loaded.";
7 X, k' L) v. F, u/ _3 Q
5 ]: P" I) ^& X, m' Z0 @- r := callLibrary(j, "calcSin", PI/6);' ?# W K' Q8 [, K& w3 x
- promptmessage(to_str("sin(PI/6) = ", r));
/ H) w6 I0 k, B* H/ B( D -
$ k8 P' m, d, L8 {- C& { - local str:string;
$ m& e' J& W& U - str := "I'm OK!";
6 c" v4 }- `9 _& N - str := callLibrary(j,"resetStr",str);
( \. `1 K" X7 Z7 F# R3 _ - promptmessage(str);
$ @, I3 [& f" j7 U% a -
+ y3 d( z- J! u& U - callLibrary(j, "listAccess", Tablefile);
7 M; X& B; q! ^: F( i+ l -
" O4 f+ G& m5 M2 {6 k o; I - print "Unloading: ", freeLibrary(j);% O6 ^) R6 N) M
- end;
. y7 f+ l! C+ g4 V7 c& ~ ]. O x R# I3 W - end;
: T9 v2 B! e6 `0 I' F+ n' G7 c& ?
复制代码 |