- is
3 g4 o& m6 c" U O3 a8 l$ O - r:real; file:string;8 t! p: u, j( [$ [# p
- do
3 S( F' h- x; c - openConsole;
, ]" u" t, `% ?* W! E - ' `, v4 z( l2 x- }/ g# E4 N1 ~9 a0 {
- /*" O" B" L5 V$ T. t/ a
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
$ U# b1 \; |# q$ j& e3 t I" H - when is64BitApplication then 64 else 32,
P% q/ P, W( I/ g9 D7 K - "bit.dll");9 z3 K4 `. b2 u+ `
- */
7 ]4 I$ i* [) W, L - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";% p" N. h* Z6 @9 s! o
- local j := loadLibrary(file);
6 ?5 M! f8 l+ e A: R6 y
* {- _3 q! N$ c9 M0 K2 j+ T- if j > 0 then. v: h& ^+ n* v* I2 _
- print getLoadedLibrary(j)," is loaded.";2 Z: o3 Y( d2 Y7 q3 k- [
- ' j T# ? e) q9 I& R% Q1 w' w7 I
- r := callLibrary(j, "calcSin", PI/6);
% j. y, `# F4 A' ` - promptmessage(to_str("sin(PI/6) = ", r));
0 l/ a2 v( n/ Y( H# C3 u - 0 i, Q3 y2 N5 R2 L2 [% e
- local str:string;- s0 F2 ?0 g* ^1 b4 c: E
- str := "I'm OK!";
' ]- u) G& P& n* D9 ?# e( V, v8 m6 U - str := callLibrary(j,"resetStr",str);
# U2 b7 u0 c' O6 M - promptmessage(str);! E/ P( X1 ], ]% v% p( l `2 a
- , V+ R% K ^! W' {/ I( u5 V6 ]
- callLibrary(j, "listAccess", Tablefile);" Y; E9 Y$ A0 j! k2 a
-
8 p7 Y& f2 A% C" c6 N - print "Unloading: ", freeLibrary(j);
& D% i1 r% ^ R" C b7 C$ J - end; y1 V. R2 ? C x7 B$ J3 P+ B
- end;
# Z2 n+ ^' d; P
复制代码 |