- is! o7 _& G3 k. S# `# z
- r:real; file:string;
0 v% D* H/ w3 a - do
) Q. d0 M; P' [( |9 H1 ^ - openConsole;0 o5 k/ m3 E" E8 M: J. T) a
- % r; Q0 t1 J! Y" y* U: c2 @
- /*3 o- K7 _$ J& x
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",4 U+ R/ ~# k+ O9 k* @: ^, e+ ] U
- when is64BitApplication then 64 else 32,
1 V2 h9 _ ?$ Z/ E; u - "bit.dll");! X/ B! \/ ]( P4 p X
- */
' D. y3 M5 o& p - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
}* ` H) [2 D+ r$ Q - local j := loadLibrary(file);& X9 O3 K9 h7 R$ \- Q
- . R9 M1 V7 P% B0 c0 n( i; Q) Y
- if j > 0 then6 ]& Z! L" P' r; l
- print getLoadedLibrary(j)," is loaded.";& H: f" P* @; q# }
* t- ]9 V' l* j% C5 ^1 a- r := callLibrary(j, "calcSin", PI/6);6 x/ `4 o. R, `( m7 e0 K
- promptmessage(to_str("sin(PI/6) = ", r));
. ^2 e& m7 ^2 W: n U J( O - % e: \9 P3 x+ r0 w2 J+ t
- local str:string;% H5 @; w& A% ?% ?& O2 ]# q8 y
- str := "I'm OK!";* f, _" e& J! K/ M- L( l/ Z8 {
- str := callLibrary(j,"resetStr",str);
& U0 ~( U$ `( k! N1 I - promptmessage(str);
E1 G+ J/ g) u - ) Y* A4 A/ h- {. u* i
- callLibrary(j, "listAccess", Tablefile);% d2 T; b" l8 D5 Y, U) |
-
3 }8 i! a) G0 W; [; v - print "Unloading: ", freeLibrary(j);
! p. t: {% G; A: N - end;
; ^% q5 q0 h3 k( }0 G7 t - end;9 l- k6 T: q" p: Q/ l4 @9 W. `
复制代码 |