- is
3 r. l5 C+ i" \; w% k6 J - r:real; file:string;
4 t) @# f( z6 \ J - do9 |, z& G) K% n5 p- K, i" }
- openConsole;" i1 Z9 V4 ^5 T% ] J' J. W! a
9 p0 ` ~" f/ @- /*# X- M; [+ t4 D% h! H+ L1 B
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
2 F* x/ h5 O7 E$ ?; f0 ^1 u& h - when is64BitApplication then 64 else 32,+ L. i: v: W) h3 V: U0 L l9 g. L
- "bit.dll");+ c% U% R9 c! C% N( n1 W
- */
. p. k5 H/ }, l* }/ Y$ I1 ^& h9 U/ @ - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";; m2 O. l+ Y% `: v
- local j := loadLibrary(file);' c7 ^$ G: f7 C. ^0 x
- ' v' G6 I3 J P7 U+ ]
- if j > 0 then9 G' w( g: \4 A/ N- R. I
- print getLoadedLibrary(j)," is loaded.";
- {) }2 ~; }, B8 \; c" D' \ - ' R0 d5 V, U: l3 }- m+ T
- r := callLibrary(j, "calcSin", PI/6);( R8 _2 s7 j+ X3 h6 a9 @
- promptmessage(to_str("sin(PI/6) = ", r));
4 A" F; z; m9 F! l# s4 A - 4 s: w4 u! P1 T, h8 J, Y- {6 z4 p
- local str:string;3 Y' M9 g2 ]- }' X( t# B
- str := "I'm OK!";
! |& D/ O8 m( F" c) x4 u4 o7 y! N9 t - str := callLibrary(j,"resetStr",str);
2 `4 ?/ Y3 P2 f8 T - promptmessage(str);
1 [% z! C4 J" r - $ c7 b0 [) _6 d1 q" k4 R4 w
- callLibrary(j, "listAccess", Tablefile);+ Y" A: R o# L+ P8 f% J/ v9 a) t
- 4 e" G: \0 |. H6 H2 k
- print "Unloading: ", freeLibrary(j);
" J _5 ^( N% q - end;
+ ~. C/ H0 m/ T+ ? - end;
) N z. ^+ }$ |
复制代码 |