- is
* Q- {1 l3 Y% k( a - r:real; file:string;1 _0 W( j% B3 A
- do6 q& q( |& O: x1 t! G& T- ^
- openConsole;/ A* L% S" o2 K3 h$ e: m! ^, H+ V
+ y3 ?2 \/ y6 i' K1 r8 S9 ^0 R' i- /*
( d/ `; u6 M. @4 S! K' E - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",% V- M3 S4 ]6 r, \( G7 d
- when is64BitApplication then 64 else 32, n& J: V( c! L) n: M9 x. i* q
- "bit.dll");0 j5 d( \7 C0 }6 S* R# U
- */! ~( M3 n# C- ^1 [
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";. e9 k* j3 c; u8 e
- local j := loadLibrary(file);
$ Q# M9 W5 _; t - $ S: P& {0 _( i6 ^* V
- if j > 0 then
8 Z5 D% S. k1 F9 `5 Y$ D3 \9 s - print getLoadedLibrary(j)," is loaded.";
/ c' b8 r2 ?1 ^( `
8 ?" H9 {& f7 _/ I: x8 K8 W2 Y1 O* J- r := callLibrary(j, "calcSin", PI/6);# B4 v4 T5 `$ o4 K/ S3 w5 v: A0 z
- promptmessage(to_str("sin(PI/6) = ", r));
. o) w+ j G( h - * S' G4 j5 ?, r A9 [
- local str:string;" r6 l! C$ V7 f5 D* ~8 l8 l
- str := "I'm OK!";
2 |' y D* G+ L - str := callLibrary(j,"resetStr",str); `% F% g: _$ i
- promptmessage(str);7 Y3 r q y L- @* B7 s i
- ( O% B2 b# ~4 V/ Z; ?; w
- callLibrary(j, "listAccess", Tablefile);: r; }. ]' k4 Y: ]$ x' I8 C
-
! y9 J( R( ~5 A v# o( H - print "Unloading: ", freeLibrary(j);
9 Z5 \- c* Q4 A" ^9 |6 k - end;
! f, r$ a1 h8 U& W3 K - end;
1 K( j5 ~" U& n& [$ V, P
复制代码 |