- is
6 R' c5 o5 V, [0 K/ @ - r:real; file:string;
' f( h: k/ l0 x( a/ U - do
" _# H- {: l! u) X, h8 O - openConsole;
$ J! L$ S4 g Q7 v h$ g
0 a* ?' @. W5 U7 i- /*
5 x! ]# l+ s; Q. v: d - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf", ^5 E- K7 } _. a" e
- when is64BitApplication then 64 else 32,0 @( s- P, Z' C* Z
- "bit.dll");
8 U, G- h* v5 O$ v - *// C% x ~& {; {
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";- A6 v, a9 n3 K2 Q4 g7 A
- local j := loadLibrary(file);2 \+ Z6 {' M& C) h. `, o Y. \
- 1 G9 u& m Y) V9 n& A$ e
- if j > 0 then
. _9 }; t" e# ?9 h1 l4 L& y% x - print getLoadedLibrary(j)," is loaded.";
" B. b* Y. n$ S! n! G" h! O
( P. b0 G& i- t I7 W0 X( y n/ {- r := callLibrary(j, "calcSin", PI/6);
8 ~: G( F9 ~- O3 B - promptmessage(to_str("sin(PI/6) = ", r));
1 i+ @+ I V Z, A7 h -
: p& \$ U* E" t& S/ L2 e - local str:string;
. v( h7 t, w/ e& F% A3 A- [ - str := "I'm OK!";" B9 L6 q" b" G5 p" T3 }8 V [& C
- str := callLibrary(j,"resetStr",str);
* y9 K9 O! c# b4 T2 `# A - promptmessage(str);
0 t V) ?: f6 w$ b" C& g& U+ o - - l* K B2 V9 D; ]" T
- callLibrary(j, "listAccess", Tablefile);1 b1 ?+ A$ M: N
- 1 Y: f! k' }! \4 n' o; d
- print "Unloading: ", freeLibrary(j);* i0 p$ |# d* w. r1 ]* x
- end;
: m2 t3 a( w# X9 J5 @# R* \7 V - end;
2 ^# w; M9 S# z" k& t
复制代码 |