- is6 _0 n4 w. \7 [
- r:real; file:string;' u4 Q* f+ _, M: s, v
- do
. n- t, a# R* g# Q& \ - openConsole;/ T$ F- j; p! x, T! l
9 Y" B' u0 Y) A6 z/ o1 g- /*
: g1 |8 u+ L0 T; s/ U0 Z$ t - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
# S# Z' j1 }; r- i# i - when is64BitApplication then 64 else 32,) T4 P/ a; B" v) @
- "bit.dll");6 {9 W5 c& H: u
- */
& S/ {$ a0 {, X7 ?! c6 U0 R - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
% P( V3 W+ ^4 \1 f3 p% w: Z' H - local j := loadLibrary(file);
6 g$ S! f( w# U) \
! `; ~4 M6 D9 F$ ^- if j > 0 then4 Y% ^% ?* l. q+ F& }9 h
- print getLoadedLibrary(j)," is loaded.";
% v9 `# V( B! A/ z( _. s3 G - 8 c# _3 ^3 L. U, C# R2 P
- r := callLibrary(j, "calcSin", PI/6);
' e: Y& T* A0 g. f4 D% | P; V) M - promptmessage(to_str("sin(PI/6) = ", r));# O: r# L- l1 F. z. a
- ( k7 Y; R1 ]0 i
- local str:string;! G( K# j( z0 F
- str := "I'm OK!";# T5 N2 y5 a- C, v: ]8 Q
- str := callLibrary(j,"resetStr",str);& v g8 l. g2 v# I
- promptmessage(str);
2 h1 T0 W( r' [0 B2 ~ g7 [2 z - - {0 A, C6 Q! L6 D9 E9 g
- callLibrary(j, "listAccess", Tablefile);' e. O, d; p% q! Z
-
5 j6 e% B2 S/ O p( X+ N) u - print "Unloading: ", freeLibrary(j);! e$ t% n: }) s
- end;
4 ]) P6 E. Y- E8 r. q# H" w6 ^ - end;
! _9 g/ J& Z/ ?$ g
复制代码 |