- is
% z$ |0 s& R- C' Z3 ^1 f: N7 F - r:real; file:string;$ n5 Z$ b' f! I* f4 n _
- do
- l3 k7 |, k- d8 z; P# N h: m - openConsole;
% v: _: ~2 J* w5 n6 R
8 C" U$ L4 ]: V! h- /*
* D$ J( q0 Z D - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",, h0 W8 a _3 c4 h, m
- when is64BitApplication then 64 else 32,
3 `: \5 v# l$ ^% \: g, W - "bit.dll");# `6 {5 \! d4 E) F: U+ {
- */* L/ T, Y+ j& f9 d4 i
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";3 ?9 m. I. f# L: R) V, Q9 t
- local j := loadLibrary(file);, w8 k X; d5 G: f% d
- " C# n2 v4 u: r
- if j > 0 then
% P7 [& f& f# M; _- G# z - print getLoadedLibrary(j)," is loaded.";, s" m7 S7 p* E, K( B r9 ~: L
3 T0 h( ?* K$ s% u0 L4 R- r := callLibrary(j, "calcSin", PI/6);% x. \8 { f8 x/ w k
- promptmessage(to_str("sin(PI/6) = ", r));$ T9 O( S! ~0 E2 B* N# ]( u0 {
-
/ ~5 r0 v; |8 R% Y; y& n5 Y: E - local str:string;" N3 R. e }2 w- Z' [6 S
- str := "I'm OK!";" o8 U7 c( L( Q+ T; N; c8 m0 X2 _
- str := callLibrary(j,"resetStr",str);
( r D5 n! ^0 }& }/ d5 U2 P - promptmessage(str);
3 m# t7 A/ E. } - & m* B6 E3 g2 `; b0 @$ o
- callLibrary(j, "listAccess", Tablefile);0 S. o0 n' a1 N
-
! I& }0 \: x7 G% M - print "Unloading: ", freeLibrary(j);7 m- v& T. p6 f7 z
- end;
- Z. A' _' Q/ `' M. y" f6 ] - end;1 I2 \8 {* F$ _% `: O
复制代码 |