- is F% G% [7 H1 n, G) v
- r:real; file:string;
$ p: X, @# W, Z f m - do2 l4 r4 r1 ~0 J& [3 ^
- openConsole;
" q& j7 q0 L. w( F5 Q2 K |
# I5 `3 o/ N: ^8 i8 F3 d& k0 ]4 d9 I0 f- /*
, }, |# I* P, F- i$ W- P9 l - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",1 ]$ c* X! {. C. k* ^9 J
- when is64BitApplication then 64 else 32,2 Q5 C, X b% f6 c6 t
- "bit.dll");2 e$ s) Q4 m- Q9 S4 b' A
- */5 v6 [9 U8 @# z3 g) f* a! ~5 P
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
- B n8 `7 s* N" r* x* @ - local j := loadLibrary(file);. ~( ^( a- r$ J& U2 r+ r A
1 r% L" x i3 E+ \ g- if j > 0 then' I# ~8 G7 N+ v p. X; ]0 b3 ~
- print getLoadedLibrary(j)," is loaded.";
^* U, E3 X I- L' r - 2 ~: c# t3 Z: {" C+ a
- r := callLibrary(j, "calcSin", PI/6);5 O, _+ \; c3 C2 R2 N
- promptmessage(to_str("sin(PI/6) = ", r));
5 s9 C" P! {2 ^4 A r$ U% g - 3 k2 B1 i( F3 }
- local str:string;5 m' D6 E5 U b# A7 V3 o# S7 m
- str := "I'm OK!";+ ]5 ~# p& g4 |* @
- str := callLibrary(j,"resetStr",str);
# ~8 l: R' g1 t - promptmessage(str);- L( R! U9 ~% E: r4 F7 B3 c* l
-
) Y+ q. @8 y( m& o' [, V3 ]# v* o - callLibrary(j, "listAccess", Tablefile);
9 A. X. M- h. Y) | - / R( r3 O" K3 G; G! p" _
- print "Unloading: ", freeLibrary(j);( J4 \1 g) j4 Z/ [! R
- end;% g5 ^! d$ Y& C# H5 h* X- ~
- end;' i& p* o- @; Z/ u! b& w( P1 q
复制代码 |