- is
- d6 N% T+ n1 C/ H+ m/ Q+ t5 r - r:real; file:string;
$ y: \; K9 X8 I - do9 \7 r4 N" b+ S* C" B
- openConsole;
5 w' U d$ N1 J4 ?+ \8 \2 G4 o' ?) x
" Q G, x3 P w2 w: l) n: u- /*; x4 I) B) F2 d/ n
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",, }$ R+ j2 G/ u* _. L2 @2 [
- when is64BitApplication then 64 else 32,
& T, V9 S4 {& r/ O- `6 Q) L - "bit.dll");
) c, Q& b. @9 l& w- ^ - */" y; v9 T: ^- D8 r5 c6 K
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";7 F! x( S1 G, D! N% V. a
- local j := loadLibrary(file);
4 U9 e, M' d' A. ?, M ~" _8 n - ) ~5 X2 ? |3 k8 t/ W
- if j > 0 then* D5 H" f* j4 f# P- x0 U! u8 \( |
- print getLoadedLibrary(j)," is loaded.";; L& S& H1 U( s N G) q; C
6 B9 W9 q) s9 @* _# h, E- r := callLibrary(j, "calcSin", PI/6);) f& T& G/ y Z+ O
- promptmessage(to_str("sin(PI/6) = ", r));; h, A7 Y% s% z. ]" B T/ R8 p/ O
- 3 o" [- f, F! k2 A$ j) M. T1 ?4 G. S
- local str:string;/ ^7 V& d7 |7 d5 e7 d1 ^
- str := "I'm OK!";; f+ b6 Y; P$ j# }
- str := callLibrary(j,"resetStr",str);
, Z' ?$ l6 `) ?$ P - promptmessage(str);
; W: d- w3 ?0 |) m -
) b7 [" D( x8 p - callLibrary(j, "listAccess", Tablefile);1 D$ F K! [' \8 Q5 G# b, E8 B+ J, C
-
) Q, }6 m9 |; b5 f; t - print "Unloading: ", freeLibrary(j);
: b* t8 o% I [4 o2 | - end;
9 K9 e% w. D4 ~% ]) ], d' d - end;
$ u8 T4 e* Q/ i4 l4 S
复制代码 |