- is- C- C6 u& e; [
- r:real; file:string;
" H k; b% k8 ]: M" ~ B5 X - do
$ F. b8 s5 j" j' f# v - openConsole;
K& L! [2 C1 f: y( n! E L: ? - * y4 A# z3 j( J" h6 D0 p7 ~% p
- /*( q/ @9 D% C# g! R# \
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
$ d# o+ v( v3 Q - when is64BitApplication then 64 else 32,1 S% M, ]7 \( L. A
- "bit.dll");
! V9 l6 C6 s. D8 C7 F2 L* }0 \ - */5 {9 r4 h2 L2 X* R
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";" {1 v* N) S$ G l
- local j := loadLibrary(file);: s3 W: h2 l# o# l
- 8 W* j. Y5 d; z
- if j > 0 then$ @7 ?; C% l8 X
- print getLoadedLibrary(j)," is loaded.";) D" i5 Y4 X2 T% X9 O, K
- . h9 @6 l) r% q0 F7 |) r) t7 {
- r := callLibrary(j, "calcSin", PI/6);
P- C$ k$ [* k( h* I+ B' \ - promptmessage(to_str("sin(PI/6) = ", r));
$ I' ]0 C" c& o) w* G - + e# ? y3 n5 O W4 {( q3 ^
- local str:string;
; y0 g/ W$ h2 Y5 O - str := "I'm OK!";
3 u9 U7 Y: K* }9 ^ j+ K - str := callLibrary(j,"resetStr",str);+ N# j2 d" q) m& j& P
- promptmessage(str);$ e0 x5 ~& d# N4 \
-
# K$ z5 I! Z& E$ u; Y5 L - callLibrary(j, "listAccess", Tablefile);
# h8 @$ n- U- t, G( w) J* d -
; ]- n* ?7 Z( ?" r+ [# j1 m6 D+ k% e# s7 ` - print "Unloading: ", freeLibrary(j);
: J, k; T" x7 [ D" g$ \+ t0 \ m - end;' k' B8 b( T7 q9 J
- end;6 K7 I2 b3 g3 d- P
复制代码 |