- is
- P: T, M2 M4 h3 H: C- x - r:real; file:string;2 c8 P2 _6 R3 Y; q% O
- do& ~2 C0 R( r% N) R7 m; p
- openConsole;
% C2 G- v2 e/ r, p1 X - ( X1 k8 ? K& \; h0 A
- /*
5 o. r; w5 G9 \6 N9 d - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
$ G( R' t4 w& W3 ]3 E- j# N - when is64BitApplication then 64 else 32,
. }3 n' f2 `, S1 Y7 N6 o, ` - "bit.dll");
/ s) v( |" Z& h3 O - */ U: m$ g* d: T& Q( x( y& I
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
& w8 ^: O4 B5 P5 }; O+ o - local j := loadLibrary(file);
0 C" m7 V' [% u9 c - ' J! Y5 Z( |7 F- y0 v
- if j > 0 then; m4 k" z. ?/ J* V- f7 b6 V
- print getLoadedLibrary(j)," is loaded.";
2 ]0 F* q4 c( m+ ?0 \$ `2 [ - # o4 Z3 x8 D) d$ k2 e% |, ^: J
- r := callLibrary(j, "calcSin", PI/6);2 P' }7 O* a: D. R8 ^
- promptmessage(to_str("sin(PI/6) = ", r));
) u9 C, W9 p% r5 j' K -
: I/ F' X- \2 L1 [7 I* v2 N - local str:string;8 h2 B. n4 l! @8 w# L4 e/ a
- str := "I'm OK!";8 S9 }) l7 u2 s1 M
- str := callLibrary(j,"resetStr",str);- t' ^- ?% `. t! e: }6 E
- promptmessage(str);( p4 ?7 r5 R& B% [
- " _% @* F. L& L9 |
- callLibrary(j, "listAccess", Tablefile);
2 w" A. f0 `- l6 b* o - , Q& t# h; K" q# v* O% Q( I
- print "Unloading: ", freeLibrary(j);; A" |/ y- Y+ b# L0 `+ c
- end;% z+ X# m- F9 @3 j2 S* E6 m
- end;$ o0 N/ o, B `1 o
复制代码 |