- is" n# i! T B; C* J9 A0 a
- r:real; file:string;2 n; U# d2 v0 F9 J
- do
/ z. W; t0 y& j - openConsole;
% X; a4 J* g) K/ c& W
1 @5 o, l, L7 c4 _2 K r- /*# }* d0 T1 l& {4 N5 q
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",# r" r& \/ X6 G9 @/ {
- when is64BitApplication then 64 else 32,
& |& k* _ |! C0 V) G - "bit.dll");, L9 U: c. T+ ~
- */
! S6 B6 u# Y5 w0 D - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";+ L3 `- D" R( u! O ?4 @+ o
- local j := loadLibrary(file);6 v2 Y6 x( m5 g) S- l2 U# \6 M
- + P, d e; y" o$ a7 v ~
- if j > 0 then
6 B/ P% e+ o4 T8 } - print getLoadedLibrary(j)," is loaded.";/ `) A) Q3 m3 T7 ^
- 8 z! h" B' M$ t" { S# E7 z1 k
- r := callLibrary(j, "calcSin", PI/6);
2 m, i( i5 E% |) D - promptmessage(to_str("sin(PI/6) = ", r));1 O. ?& I# f1 }: |& Q: t8 Y1 a
-
4 K/ F% k" @6 T- p" W - local str:string;$ v# l* W0 O* i8 t7 V( J& T
- str := "I'm OK!";
: p/ L6 R: ^9 e; [, @ - str := callLibrary(j,"resetStr",str);
6 ]8 ?: X2 q F: t; M - promptmessage(str);
) K3 [) Q# N5 I4 {6 e -
5 X: n7 J# X# u. M( A4 }7 N7 X* ` - callLibrary(j, "listAccess", Tablefile);& I* B, Q2 I/ H3 ~
-
7 m$ M4 v: g n; G+ |4 z - print "Unloading: ", freeLibrary(j);
/ f7 T' n, p: ?$ `+ B8 w - end;
, s& d) w: N4 Q& S# Y' K w% s - end;
0 L j( f/ c; U+ e9 C& t i
复制代码 |