- is
; E7 n( [8 d/ Y6 g, R3 [$ m( b - r:real; file:string;7 ]* J5 K/ _( T2 E( v. n" R
- do
& M* ]4 d" b: h: l* Q9 F. Z1 ]. P - openConsole;
" u6 L7 t% q9 {3 P. A
- g: B# p' {8 d0 T& b- /*
Q5 X. h8 l( y+ ]' r4 E - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
6 o6 N4 A) |. y" S$ v - when is64BitApplication then 64 else 32,% T7 u: w# E& S0 {
- "bit.dll");. k6 y( p# [+ I9 _+ c" q
- */
+ y# a, ~9 }3 o0 f) i2 ^* T- z* ] o - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
. ]" K, [5 o! w! n2 n9 o5 G - local j := loadLibrary(file);$ b1 }7 G5 A6 G
- . ?9 a, t) y; q" @# T
- if j > 0 then' u- C. u" q b9 C* d7 p' x) P7 t6 c1 F
- print getLoadedLibrary(j)," is loaded.";
' V- t- G- t. h, q - $ a+ B+ Q A/ J1 Y' \1 \
- r := callLibrary(j, "calcSin", PI/6);
9 C4 s0 s5 G6 e# p! d0 C. t - promptmessage(to_str("sin(PI/6) = ", r));8 O- q3 d+ N2 {. z2 n5 u
-
6 |6 A! Q7 ?& S! s$ w; }1 P - local str:string;. x2 B5 Y8 |/ S% d4 j7 e- q7 _! d
- str := "I'm OK!"; ^7 P! M( F5 X/ W n9 s5 l7 ?: z
- str := callLibrary(j,"resetStr",str);
$ P0 h$ `. G8 H) l9 {0 k/ H3 D/ T - promptmessage(str);7 y# F8 R6 p! o) y
- 8 z" J5 Q, h/ O
- callLibrary(j, "listAccess", Tablefile);7 O" L! p0 `' s/ J2 m5 y+ F
- $ i6 ^5 |, [4 p9 |
- print "Unloading: ", freeLibrary(j);
0 r! H+ r6 @( M! | - end;' D& L7 r$ [& |( U! g! o
- end;
9 U; j4 }6 R, ]( g5 u% z) A K6 Z% }
复制代码 |