- is$ |, b. p7 o8 J; g" P
- r:real; file:string;6 [! `) W$ D" t+ h( _0 w4 u- s0 y
- do7 i1 n+ V+ n) n2 _, D! g
- openConsole;
& N' W% y- o. ?7 j ?' W5 |+ k2 D' t y - ! [7 m+ G( q# _8 H2 J
- /*
9 E& q: ^0 v: [9 S - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",( \, E/ H }" j9 L( Y. G$ d$ U
- when is64BitApplication then 64 else 32,& `" ?8 l; f; L+ ~6 J5 h- F
- "bit.dll");
$ s: S+ `4 b0 J - */. @; F ^# b% Z+ j9 w
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
, f7 C- p2 {) _ - local j := loadLibrary(file);
9 e8 i- k( a) ?: U8 _, i
; ^$ f( g' |3 I. N3 w0 J- if j > 0 then. B' o# T7 h" t2 v( z. L
- print getLoadedLibrary(j)," is loaded.";
& H) m, @& n4 E! ~; X/ e; @7 R - 4 N- o- G9 v4 b7 S$ z
- r := callLibrary(j, "calcSin", PI/6);
; {+ H. f* N) E& I/ \. `! i6 y! k8 e - promptmessage(to_str("sin(PI/6) = ", r));
& ^" B2 @# B3 b j0 d/ m1 N& } -
# L7 q9 M- e. S2 t5 d$ a" m; j - local str:string;# ]1 K. D0 `0 P
- str := "I'm OK!";: T8 [# c7 |' V' }
- str := callLibrary(j,"resetStr",str);. t3 n, b6 V# c3 \* r' l2 G
- promptmessage(str);9 [* `; h" ]) w# c
-
& P/ C" O) P4 N3 `- z6 g9 j6 O0 M - callLibrary(j, "listAccess", Tablefile);
& c) s+ F9 v: G% W - + x( H3 c- G5 D% v8 j- h0 R
- print "Unloading: ", freeLibrary(j);
t- Y* ]. ?/ a/ P - end;
" S9 {5 V. L) u6 M' m - end;8 t2 u* ]3 P4 D% z) O
复制代码 |