- is
, }# {; D/ S) S' t! L+ G: y8 x) N - r:real; file:string;
; R* X& `. l- m* u, v6 R - do
) }! {9 w8 \, h - openConsole;
6 Q' R5 F2 S* x/ T: `! b - S/ ^6 {. I" X# J1 g% r+ F
- /*1 Q( R. w( g5 [1 a
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",/ N" b0 K* ~0 |9 Z
- when is64BitApplication then 64 else 32,# i/ G ^: K8 O2 v; C
- "bit.dll");3 _" b1 p6 t% Y7 X7 a4 p" M9 X
- */" V3 \) F3 a1 z' ~" x0 c. }4 @" }
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
0 w4 U; ~ u% I6 `" `$ A# n6 n - local j := loadLibrary(file);
; `" z" B1 O& U0 E! c7 C1 L4 g" Y' Q - # \$ o8 c) ]7 F" P
- if j > 0 then
3 `0 c! W( |3 L1 w k* S - print getLoadedLibrary(j)," is loaded."; G1 ]# U6 d# |: p. L. G1 K
- ' o4 V" x( @1 W( `( h
- r := callLibrary(j, "calcSin", PI/6);0 G5 Q& a+ m3 X& ]9 d) P, ?
- promptmessage(to_str("sin(PI/6) = ", r));
T; h U5 p5 N+ F J; T- d8 b -
/ |" N, U9 L9 q8 Q) b - local str:string;
z0 y! o v( p& ~! s* G2 D4 Y8 n - str := "I'm OK!";: L Z5 B- c! n) X* `) d
- str := callLibrary(j,"resetStr",str);
1 |8 L% e+ X7 {& A - promptmessage(str);1 K8 N# g; X4 k; N1 ~* }% R( a
-
/ `* C" @3 f3 h3 d' S4 O5 ?" g$ W - callLibrary(j, "listAccess", Tablefile);
, r3 v9 I$ x& ?% `! d# z - 4 z$ P3 {( x2 Q0 ^; D7 E
- print "Unloading: ", freeLibrary(j);
0 l- m. ^( w7 r3 c0 H - end;' |4 }! |3 w. G; M
- end;
/ J. I. G0 J: A* ], l3 e
复制代码 |