- is
$ I8 O# I0 h% Z. g D2 o - r:real; file:string;7 M4 D. I0 n2 ^
- do
3 h W1 r/ Z: N - openConsole;
) z6 E* `+ i/ K. n; |
* M% I4 [4 P+ @8 J8 e5 q+ v- /*
; \& ?" a% u* o/ J - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
. T' G% C5 H5 U$ y! p0 B* U - when is64BitApplication then 64 else 32,5 ~2 N O ^) E( ~
- "bit.dll");
# _. C9 `% e' o+ j! w# X& b- u& W - */
" f- n' p+ K) d8 P - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll"; \5 w1 k( p: n8 ^- N+ {
- local j := loadLibrary(file);
5 {! u$ J1 a" ^ - 5 ?6 Q* `" L2 b4 E% p. z# D' N) w6 R+ _
- if j > 0 then2 a/ b8 q4 W* ^0 M, o* s. J
- print getLoadedLibrary(j)," is loaded.";5 P" _4 t0 r# b2 I3 n' x
- 8 g* ^7 B6 W5 ^6 C% v) r3 \, v% {
- r := callLibrary(j, "calcSin", PI/6);
. \" I3 l+ G, z. _- V - promptmessage(to_str("sin(PI/6) = ", r));+ L A I% M9 h% C+ f m" t( h
-
1 m0 M" H3 [1 F - local str:string;4 l m7 L8 E2 D! D
- str := "I'm OK!";- e" m. t0 ]7 J4 i+ z% R' U
- str := callLibrary(j,"resetStr",str);
7 e \- r7 e, |/ W+ N& A/ n* Z/ U - promptmessage(str);$ ]8 W7 B6 ]" Q/ r# C
- * @2 N# R0 j$ _9 \2 j2 ]' r
- callLibrary(j, "listAccess", Tablefile);
4 R% m$ Y/ W6 s8 Z0 t) p - ' M a; G' k% a6 G: D
- print "Unloading: ", freeLibrary(j);" x2 o: {9 y. \& D' s8 y3 [
- end;
u, Z. c. Q: o7 f- P7 O) ` - end;. O7 h9 @' g: a
复制代码 |