- is0 B3 J$ f6 b; `' ^
- r:real; file:string;
$ w' n: g+ j# |. o# h& ?5 e - do0 Z% X4 J) ~) C
- openConsole;
! L o4 j9 x% D, I) F( @/ q, q4 Q
# f) G% o5 e" v, V Z7 w- /*
: X0 N% T6 L: L x# E M4 X - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
# ]& V( L7 `# i% _, S - when is64BitApplication then 64 else 32,- s, |* G! |) z
- "bit.dll");
1 W# q& _8 W6 O2 l* K1 w% z - */ J- c2 U) L. ^! K$ s0 I! M
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";: G6 n0 E+ N+ E# A. c* ]. A. l- Z
- local j := loadLibrary(file);$ V6 a/ z- p4 v
- ' j' C3 G- h* L1 {$ {% d
- if j > 0 then$ j) _% O# ^7 P+ ]7 w( y/ G4 ~
- print getLoadedLibrary(j)," is loaded.";
6 n% G% X3 n2 B; U6 o; M - % L" g4 w5 S9 y
- r := callLibrary(j, "calcSin", PI/6);
/ H w _* a4 ]% p - promptmessage(to_str("sin(PI/6) = ", r));% F2 d. t U2 n4 ^
- ' O0 ^2 T. n: |7 o' a' t" X) }
- local str:string;4 u8 \' X8 D- K+ J" e' t& L2 P7 K
- str := "I'm OK!";
: W2 U* S9 y" O% q) |$ Z - str := callLibrary(j,"resetStr",str);
( D6 t% w% [% @) G* S8 @ - promptmessage(str);/ d+ E: X R& j; M- q5 n: w& t; E3 `
-
! P* }0 y2 x! |7 K* k& @; ? - callLibrary(j, "listAccess", Tablefile);
$ K* S( J/ x1 ]$ o1 |8 s. h -
3 @4 @* J. c8 d - print "Unloading: ", freeLibrary(j);/ b# f$ B6 G* O) z( n/ X+ X
- end;
! h: L0 d. c" L. O9 C6 v, ` - end;
. k, |$ k# n" w: G9 T0 V6 ^) |
复制代码 |