- is
* b$ R: U3 V2 D, g0 i - r:real; file:string;- q+ j- q! P; Z) @2 s: e% ~% M
- do$ X. K3 H4 @+ i" X
- openConsole;/ X( z! G7 d8 D2 I0 X5 U$ a, s/ Y
- - H( s$ b! }! R) w
- /*
5 X- [( d6 n4 R; c, a - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
/ a7 u4 h4 V& a - when is64BitApplication then 64 else 32,
4 D1 ?: ^( o0 D$ R3 J5 n4 D( b - "bit.dll");1 ~1 \! j( G: n5 j( _
- */# A$ y k& g" [9 F' ~8 W* l0 i
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
5 @3 a r* ^) x* X/ T& o6 q - local j := loadLibrary(file);
7 G1 ^; R$ l$ Z' D0 `3 ~ - * X, \0 Q+ q: q5 I2 I
- if j > 0 then
" n$ d* ^ \% f- w' L - print getLoadedLibrary(j)," is loaded.";3 O, J0 h e3 G- C+ j* X p3 a
- % ^7 b; P4 c$ d% n* ]
- r := callLibrary(j, "calcSin", PI/6);
8 _$ }2 C0 F+ e2 r! U - promptmessage(to_str("sin(PI/6) = ", r));
) o( R' K) c- i* K$ p - " P }* U" I, k: f
- local str:string;
/ K0 Z: e& Q, w5 q) S; t$ U - str := "I'm OK!";
. G, w; x+ O0 s; N% `8 J - str := callLibrary(j,"resetStr",str);
2 I9 _9 h7 Z7 w# o - promptmessage(str);( P$ H2 x6 f+ |; O0 k
- ) j/ v# @5 R5 c- r6 b
- callLibrary(j, "listAccess", Tablefile);) |5 h1 m/ r" }. Z2 m4 H
-
- z }: t6 a( f( M5 U' @+ I - print "Unloading: ", freeLibrary(j);) H/ q k+ c' K3 L. l' \
- end;. V; b) N) M+ e) G+ q: z
- end;
/ a6 c9 a( V2 c: B& [
复制代码 |