- is
) W: \$ v4 b7 B% o - r:real; file:string;
* E! h5 Q" u) o8 m+ @ - do
9 r% O# \4 e7 S9 a! W+ O" z - openConsole;: G* `! Q) r S0 ~! J$ |' B
5 s' L! P/ @0 g) j; n- /* F m- }+ \3 Y5 V& \
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
, C M/ Z# L9 M* w7 d2 J! ^: I: p - when is64BitApplication then 64 else 32, ^5 O8 m9 ^3 b
- "bit.dll");
3 s7 U4 C" p, l% f; A! y% Q - */
9 n+ ~$ N8 v; _ - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";; _+ [+ a9 h0 z z t2 x5 S
- local j := loadLibrary(file);! Q+ k7 y+ }4 X% @6 x5 F% O
" l. W) ~6 z4 X0 i- J- if j > 0 then
. ?2 k' e I" V. Z/ Y( B4 @) j/ E - print getLoadedLibrary(j)," is loaded.";% ~# V8 T1 z/ k h9 ^! [( p: H/ k, L
- ' v+ j5 i! Z! W T) V2 b
- r := callLibrary(j, "calcSin", PI/6);
0 U+ z0 ]0 t! L" ~% O' P7 W8 p - promptmessage(to_str("sin(PI/6) = ", r));: c9 x; N# Z- F8 U2 S% E, C' N5 d. Z
- ) a8 b. c: ~9 `
- local str:string;6 n. f+ [9 c9 M7 P% S3 \* {2 ]2 ^
- str := "I'm OK!";
7 e$ }- e# W# I7 v$ x - str := callLibrary(j,"resetStr",str);
0 x8 S8 B5 Q# ?. y+ {' J% t; S) \ - promptmessage(str);1 L, j6 }! P L3 a
- ( M, E# k; \5 Z. Z5 @
- callLibrary(j, "listAccess", Tablefile);
8 W& W/ G% ~0 T+ I - ; i9 f+ M" ]6 X; k; M: _
- print "Unloading: ", freeLibrary(j);3 o% F% n" M* b7 F2 n9 l* w( i
- end;
3 r Z' m9 L' p/ k1 J1 J! K - end;
* u8 [: [ s: x
复制代码 |