- is
# ^% h% ^ w2 D$ z - r:real; file:string;
! e! E$ G, G6 C7 Z. l - do
' Q I2 e$ ?( z) V& N7 j2 a - openConsole; Q% O- u' U- P1 ~8 w! f: w
, \3 |: R& n% O9 P, M6 j) y' i- /*
R: U$ J" y0 J( z4 s" K2 e Y; [ - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
4 P+ v6 o8 @. d - when is64BitApplication then 64 else 32, \& ]3 w" }0 |* k
- "bit.dll");
+ @$ k, k9 ~* S0 K8 |- t, L - */& o' y5 K2 G" H( I
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
3 Q3 Z" ^& H; J6 ^2 k - local j := loadLibrary(file);
+ D9 E! |/ M$ x% ]* Q- x4 V6 j7 A" G
6 F+ m- o9 O. d- y3 U O7 b1 C9 t- if j > 0 then- ~8 F% c* x; v0 ]: ?+ @6 y
- print getLoadedLibrary(j)," is loaded.";( Y1 j' ]0 l; w( @7 t4 |
- * i) d, t1 N9 @$ m9 e- S+ ~
- r := callLibrary(j, "calcSin", PI/6);) P4 g0 |7 B0 {5 I- o+ x- H7 [9 F
- promptmessage(to_str("sin(PI/6) = ", r));
% Y) U/ D X% B* c" J% d6 { - a6 L) L7 o9 N/ {: m5 j" h6 h% Q5 V
- local str:string;
" I- V8 d# l5 Y$ O9 R9 @6 M - str := "I'm OK!";8 E# q8 c# b n s6 ?
- str := callLibrary(j,"resetStr",str);
0 k! y ~" E/ I) l/ M - promptmessage(str);% w- y1 |3 m) ?( P% m
- ( a/ a) {2 D, I- L4 ~) z }
- callLibrary(j, "listAccess", Tablefile);
; P& N Q! \& u -
# ~0 W$ y4 K [' A I; w6 w - print "Unloading: ", freeLibrary(j);
/ \$ F4 A; R7 ]/ G' \2 | - end;1 A) i. F) H7 I9 T1 r
- end;
7 ^6 `3 _( `3 V9 T! d; F% D
复制代码 |