- is
- Q4 O4 {: k% B0 _/ n - r:real; file:string;
- w0 @) n' `& f/ ~# c - do
g% Y/ b: c, x! l - openConsole;9 |0 ]& ?9 k, G* }9 E
- . J$ [& I' E8 F
- /*
( S9 D- u) O5 g7 K$ O - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
7 R1 c; B) \# U" m) q, A3 U( P - when is64BitApplication then 64 else 32,
1 X! V0 A1 c9 @' ^" F0 | - "bit.dll");, w9 {! l; I& B8 D/ g/ |
- */# k& y$ z% k. P2 }+ T) d
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
. t' c. I# [) [) @3 M; T2 u - local j := loadLibrary(file);, e8 C o4 c4 a, _7 k& d
- " x3 }6 U! ?2 {, ~
- if j > 0 then
& ^. q% n/ ?4 Z. U; G4 _* S2 k% X - print getLoadedLibrary(j)," is loaded.";3 j$ q6 C! Q, Z
+ N) k( ]& @( [2 n/ t* T8 h9 d3 z( X- r := callLibrary(j, "calcSin", PI/6);
% D; r {" u- Q) s, h o - promptmessage(to_str("sin(PI/6) = ", r));
: K" }/ _* L, h- I. V8 ]. C* M5 Z* C8 C - ! P/ k2 b4 e" Y: o- a
- local str:string;/ f7 X) }! R0 n+ S U; D
- str := "I'm OK!";
* c' i* b8 v$ h) g - str := callLibrary(j,"resetStr",str);! i% X- l$ W3 `( `' n% a
- promptmessage(str);: K3 J+ @3 U2 d( r2 s- M
- 8 U- j" B& f' O# y* O3 k6 y
- callLibrary(j, "listAccess", Tablefile);
+ z" O4 z! ]4 P' k) m) L) o8 M -
; F b( ]* X! P, H* u4 c$ S+ S - print "Unloading: ", freeLibrary(j);
) \4 X$ A {( ? - end;1 U! L; a+ c8 r4 ~( S
- end;! e" T0 M0 ~2 Z* W0 J! I+ U- d% o
复制代码 |