- is
6 j' j$ h; A. Y( B2 g, d - r:real; file:string;
% c8 V2 s! }. `& H' U( ] - do3 J- S0 J4 ]" J
- openConsole;" f" k$ Q% S! j
* J! U9 J% l0 I- /*
! J- u$ y# b: F7 s0 E* X! l - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
0 V$ R5 n0 i |- [2 C - when is64BitApplication then 64 else 32,
, A7 O. L) ~3 h+ T$ c - "bit.dll");
1 k6 Q" _- u' P$ b( W2 j - */* {" y3 ~1 m9 F- x6 O
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";, m* B0 F+ x; Y* `! u
- local j := loadLibrary(file);5 m0 `# S0 T, ]8 V' X+ ]. P0 d$ B
) U* Z0 E+ a/ `# f: l7 M- if j > 0 then5 w& E8 b1 ]) L6 T% x) |
- print getLoadedLibrary(j)," is loaded.";
: S: U1 u. Z* F% z$ U0 y - 4 j7 x; o9 u8 J( X# Z9 P* W* z( g
- r := callLibrary(j, "calcSin", PI/6);
# J9 G3 F$ N1 A5 M- s- W) Z - promptmessage(to_str("sin(PI/6) = ", r));
( O5 u- _3 d* S' ^6 ? -
; Y3 _8 e9 v7 i5 F0 N8 H2 D - local str:string;
4 h; b8 s8 v; \* o# h - str := "I'm OK!";
+ e9 i- o- X8 B! T - str := callLibrary(j,"resetStr",str);: q8 {, G0 p( _- W
- promptmessage(str);: x3 B1 Z# _7 f! t4 _
-
8 k8 W: e' G0 ` N - callLibrary(j, "listAccess", Tablefile);
8 j9 T" B* E3 s' h- H - ' V! t2 q* K9 Z# V7 z: z
- print "Unloading: ", freeLibrary(j);
$ Y: W: }4 R |, c$ T - end;
6 A! J$ }- o k# }$ H; Q - end;" o7 i1 D1 I$ x) a6 L
复制代码 |