- is! R9 K e" N# C4 N2 s; l
- r:real; file:string;$ H8 W% ] m7 [7 _6 U4 d
- do% V$ ~# x1 T3 x S& Q
- openConsole;& E2 K! f4 t& V4 t+ l' R0 _% h8 b
+ E) x4 x) r1 g" M: c- /*
% _2 i0 ]' v1 }+ L - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
{- E# Q: y9 f- \( l D - when is64BitApplication then 64 else 32,
" K! D1 a6 [/ H( }0 S3 [ - "bit.dll");& y: r1 Y4 x# |( M' z
- */+ ]4 ~1 j) H V$ r) v. K% e* r
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
# S2 O/ S2 d7 n5 M( t - local j := loadLibrary(file);
! J& o# j; Z+ V+ r' x - , v; i8 r! i: e: F/ V& S, x+ g R
- if j > 0 then
# {- M* i, i3 V, k: I - print getLoadedLibrary(j)," is loaded.";7 P2 t; Z, v: m7 t O$ k
, |) a7 j. e0 P2 v4 l: L- r := callLibrary(j, "calcSin", PI/6);
- Y% |: ?, {: ?# A - promptmessage(to_str("sin(PI/6) = ", r));
8 Y( R. N$ a( d4 O -
4 O" a' K3 Z% g* y3 t+ Q; O - local str:string;
. {3 L" n) m9 ^" u( g( [ - str := "I'm OK!";7 R) d I2 t+ y- r) l, }
- str := callLibrary(j,"resetStr",str);
9 c/ A- Y' G0 `- }+ D1 j4 u4 J+ H; Q - promptmessage(str);
9 Q- W2 C6 h* u+ a -
& p( }: Q2 l3 e% A - callLibrary(j, "listAccess", Tablefile);' P C8 |2 `2 s- @0 m6 O! c
-
3 z. N, Z( Y c" ~$ ^8 l9 H - print "Unloading: ", freeLibrary(j);' c( e. r! h* z1 S1 P9 v
- end;9 f; x+ P- I: C3 n8 ~4 {" L
- end;
0 E$ Y4 Z$ F( z! V- u, E4 X u# \* I
复制代码 |