- is% b- t) R2 Z+ V7 H" q8 k
- r:real; file:string; o0 v2 S- h, y! s p9 y
- do, e7 L- q) S' y3 R6 O. d
- openConsole;" G8 _. V- S' E' x+ E% I9 m t! {- J
- 6 n+ I! O: v n3 U! ]( s
- /* z" h" ^; M2 A2 f
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
5 R& h. B+ k0 r4 L9 X" e" C3 W7 z - when is64BitApplication then 64 else 32,6 u7 |" P- n, l
- "bit.dll");
- C, Z0 N3 b0 E - */7 w8 n( L$ l. i, p
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";5 \! w' y: f2 j
- local j := loadLibrary(file);
' ?* X0 \! v* I9 v6 @7 [ - ' n3 m( p# }+ k; t) e; I
- if j > 0 then
. d* x; n {7 ~6 A* S7 r - print getLoadedLibrary(j)," is loaded.";8 D6 q w9 V& R7 M
6 l: [; U' H- G9 f- r := callLibrary(j, "calcSin", PI/6);
6 x; S& q# B. y% ]$ S - promptmessage(to_str("sin(PI/6) = ", r));
3 H1 V- ^! y. }4 m1 m) V - 8 `! o% [; z D
- local str:string;
/ b7 w8 e9 ~4 B" U - str := "I'm OK!";. j$ r6 M Z' L' L' ?
- str := callLibrary(j,"resetStr",str);
$ u7 u8 S L: z8 S1 ^$ p9 K O - promptmessage(str);' a' m) V6 }* H8 j' I5 H9 ?
- ?- R0 G/ |7 L8 x/ ?9 l! O
- callLibrary(j, "listAccess", Tablefile);4 {! @3 Z5 |3 B4 R/ J* _
- * ]( i8 a/ b- n0 o4 s0 G
- print "Unloading: ", freeLibrary(j);
6 V( Y; m, g4 W7 o5 V! R - end;+ S6 M7 \7 S* U
- end;) v/ j- T0 K7 M5 h$ V
复制代码 |