- is3 Y v# |# P& p
- r:real; file:string;
0 `( u) r" O+ d. H/ Z7 U1 U - do& G4 M% k3 Y! @
- openConsole;1 X/ S0 V5 o: a9 `' V% W2 X# k
- $ [. u W7 C% X3 r, R/ N' l7 ?
- /*; s; g( t" \: D# j( i
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",- k& D% R8 Q7 z- i7 q( _
- when is64BitApplication then 64 else 32,
( J8 D6 ~" H* y* d* R$ f/ O - "bit.dll");1 a2 J8 {7 F) N u- W5 a
- */
6 i, u' P* j' Z1 x - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";% y- U4 O& F# p5 m
- local j := loadLibrary(file);- F9 k3 w* x7 U) M
- L1 ^# Q+ k3 N! ?' G7 {- if j > 0 then
- E5 D- r3 g+ C7 V j - print getLoadedLibrary(j)," is loaded.";
6 W+ ~7 P; y! J) n - ! J. m0 D2 e# L$ K% } Y
- r := callLibrary(j, "calcSin", PI/6);& E& X% n) j3 T+ K A
- promptmessage(to_str("sin(PI/6) = ", r));; {7 N/ r5 V! R" K& X0 v* c
- ) w9 L, T1 a, w( ~
- local str:string;
4 g. L1 s; p0 ^; D5 p - str := "I'm OK!";
8 J3 D+ `, A* s, a3 ` - str := callLibrary(j,"resetStr",str);
! X5 C2 [: ~ g$ c/ b - promptmessage(str);' b' N. o% N% n) `; }
-
1 {$ ?. Q1 p& _( m' f - callLibrary(j, "listAccess", Tablefile);
0 r, @: M' n8 {) C -
7 A" s8 z; P; Z. G - print "Unloading: ", freeLibrary(j);
. ?8 b q- h5 W+ k/ ]" J - end;9 X( b+ d8 y4 ]$ p% C4 V
- end;
6 p# V5 }$ E( M6 ^- h4 n* P! L5 v
复制代码 |