- is
; W5 c5 z9 L: t - r:real; file:string;) t- U g+ l3 @, C
- do
( [7 L. n4 o$ k - openConsole;
- P$ {7 y2 z' R. w. ^ - + v7 T( n* a- N8 S! U
- /*3 m& R% M( A$ i9 @9 N) q6 ~3 q
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",- H& J# M( w1 m4 o6 N
- when is64BitApplication then 64 else 32,
9 h! `7 J G3 \$ v/ D5 w - "bit.dll");5 X* [! a3 z' q
- */0 ^0 O! h+ r% `* i2 j
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";6 F' t3 k% S+ f f
- local j := loadLibrary(file);
2 Z# ] g2 e4 x9 V6 x) o - 5 _8 h3 I* l' G1 b& V0 h3 Z( {, O8 I
- if j > 0 then
3 y- G& d$ G" ]( y& A9 v - print getLoadedLibrary(j)," is loaded.";
4 U8 x% Q2 y5 }* P: X9 F: g0 S5 g2 T f
& a0 E, G8 { m- r := callLibrary(j, "calcSin", PI/6);
: q5 X* D3 n3 ^7 h3 O! N' \ k7 k+ {$ S$ M - promptmessage(to_str("sin(PI/6) = ", r));
1 T" B2 J- U" h) _1 J- Q a - # n( c/ S# }, a4 C- D
- local str:string;
) o- ]7 S( _; k# t( S# M$ d9 H6 I - str := "I'm OK!";, v8 W4 d9 w( I! p6 N4 M
- str := callLibrary(j,"resetStr",str);
$ K# @" X j U* a$ v - promptmessage(str);+ d) k( }2 X- ?5 p
- 7 V$ V& n3 z1 u. O& P7 g4 S
- callLibrary(j, "listAccess", Tablefile);+ _! f, g" z8 W" @3 o+ q
-
9 H" l, G! {( q" O) D - print "Unloading: ", freeLibrary(j);
8 @/ r* H2 B) f' d' @ - end;
& `, N8 I4 V2 l5 m$ a. }: n( Q - end;
4 ^( T" L- ]# w# `& z! u$ n8 a/ A
复制代码 |