- is
) N* G, n3 l. O) V/ N* ? b( v0 p - r:real; file:string;
$ @* q# k6 G, C) j1 H2 x* ]. O - do
; z* m) u2 P0 `) p2 j% p - openConsole;( ^, l& ~) V8 B9 K M
- " m4 [- W& ] j5 }2 Q$ V$ r! q& l }
- /*! N6 o* e+ D, u, B3 |
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",4 H' s2 @- G* G/ n4 W" ~
- when is64BitApplication then 64 else 32,' ]& G; m# l- Q" J# k8 M
- "bit.dll");- h3 E; S! ~' i& L
- */3 y+ N7 @2 L2 o
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";3 ]" W* D0 j' W: n% F0 K% d
- local j := loadLibrary(file);9 t' @2 @9 _1 V# A
1 B! q- g4 {; w; ~0 q, @- if j > 0 then$ n* F1 k4 ?8 d
- print getLoadedLibrary(j)," is loaded.";4 x4 {, @% Q K* s+ ?
- 7 M% n: u2 S, c; r
- r := callLibrary(j, "calcSin", PI/6);
4 Q3 n- W# z7 Y, J - promptmessage(to_str("sin(PI/6) = ", r));- r Y1 a% j. t+ {: W
-
% K: ]0 Q( i% C- L. x9 e - local str:string;
) t7 |; q5 i- N6 G5 h; l2 j* R6 ^0 W - str := "I'm OK!";0 k( E d0 \$ m
- str := callLibrary(j,"resetStr",str);+ b+ J5 C# g& F& k; Q& H6 Y0 z
- promptmessage(str);# g$ b F% t$ Y* v+ C+ O# z
-
9 W/ J, k. i! {& j" V- K$ h+ S - callLibrary(j, "listAccess", Tablefile);
7 K$ T% y, r1 w4 W/ P6 I - 8 ^7 j/ r, l' |
- print "Unloading: ", freeLibrary(j);' O) d: Z% Z, N, ~, ^: z
- end;! S+ k, F/ I$ o2 Q+ A3 }
- end;+ T' u6 w# T9 N, s' H! N5 i. T
复制代码 |