- is
9 I$ U8 v0 K/ s) {$ J - r:real; file:string;
0 {- |9 L( J) S, o. \9 a& V5 Y - do
) c# o# J# P b# f/ ? - openConsole;
D7 `2 E3 y. R% h/ {! w
7 w) j' @: m5 T4 r# f, n- /*
2 v! a E7 T+ C: z A% b - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
# c0 f. O' Q2 T4 A - when is64BitApplication then 64 else 32,6 I- E F; g3 o0 m( U1 z. S$ N
- "bit.dll");
$ w* @3 E5 Y* t4 N5 i - */
; O- I0 |, @- G8 P7 D7 D - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
9 E; ^% k; g9 A) z - local j := loadLibrary(file);8 K0 Z6 I$ Y8 h6 K" Y8 V
+ _ h$ C: W; o' e+ u7 h1 k" D- if j > 0 then/ |- ?1 O9 ~; Q5 Z+ a5 l
- print getLoadedLibrary(j)," is loaded.";
% f" c. O) o X' b5 Q9 d
4 E) W; u* }: ^% G" Z- r := callLibrary(j, "calcSin", PI/6);
4 f, O- a7 G! M' E8 X5 b1 j8 h - promptmessage(to_str("sin(PI/6) = ", r));% u) O3 d' Y7 M( P# b' G
-
% M3 e/ K9 I7 z" Q5 }4 G - local str:string;6 @/ G( n* _" D" N! G8 E: R* a
- str := "I'm OK!";' J( D/ `+ w7 I6 ]
- str := callLibrary(j,"resetStr",str);% w+ ?3 V. y4 X$ s8 }- f0 x
- promptmessage(str);
# Z8 ~% o: I# w3 x0 [' @ -
9 m- ~, N6 K+ u - callLibrary(j, "listAccess", Tablefile);
+ G5 o! @; V, ]6 d# |7 m& C - , d; [, Z' S' I9 H8 @6 o& s! x
- print "Unloading: ", freeLibrary(j);
6 Y4 y) T, P0 w5 q - end;
' @) E$ U3 Z& q - end;2 P5 |3 E9 X5 H D
复制代码 |