- is2 B# E$ O- {3 n, A! ?% s D
- r:real; file:string;
% |7 I$ V6 `+ K1 s, p* d - do
5 ]8 Q3 O. M; {$ \, t# j - openConsole;$ }' |$ P1 o9 }/ Q8 U7 B
( z- A, `; d& y7 \+ w6 G) B- /*' v, N: F- Z: e
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",' Y' W; ~ t3 } k- X
- when is64BitApplication then 64 else 32,3 L0 l8 w' [' n5 [7 Q6 [
- "bit.dll");
- X. J& R0 y9 L4 {4 m* x - *// Y: t; o o v: Y5 L8 A0 l0 J
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
4 r# ?; J8 R) Q - local j := loadLibrary(file);' @7 k; e' t) t" K- X, k$ l
) T- C3 \$ Y! g" L# C- if j > 0 then6 s9 b$ u. h, s" c8 X7 u
- print getLoadedLibrary(j)," is loaded.";3 m0 V3 n3 L0 N' i! A2 g8 B. _6 C
- + M! l0 ?4 [/ S/ M
- r := callLibrary(j, "calcSin", PI/6);
: s9 J; w; h8 D0 q$ b - promptmessage(to_str("sin(PI/6) = ", r));
8 N# q9 F7 x* I# G. @& M - 0 P- h6 q* H5 L% ?+ M+ N* e
- local str:string;7 n) m0 |% z0 g f/ v$ C
- str := "I'm OK!";
* a- O M6 s6 v' n8 t& S w3 m - str := callLibrary(j,"resetStr",str);
+ g a4 l0 O$ z# y# M n: \% y - promptmessage(str);5 D1 j/ V$ Z2 c: H6 T7 {
- 5 a1 n. T7 H3 v
- callLibrary(j, "listAccess", Tablefile);" ]1 Q' x# D& N, U
-
) w) A8 b1 t n2 P$ R - print "Unloading: ", freeLibrary(j);+ `. D2 s3 Q8 R$ s# l
- end;) r( R: s( Y! C$ o, g, j& r
- end;
6 Q. W7 X) }7 J% M( E
复制代码 |