- is; @, f! g- t$ k; L6 l
- r:real; file:string;$ P" u( @* p2 m% x/ P
- do
1 T: H/ u' i$ @7 F# @7 k - openConsole;
Z5 B- _- q" t1 @0 l
0 C% J- N4 L4 s5 q9 f4 O. {; f- /*
d% e" R8 b: m9 Q6 |2 F/ N - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",$ T# _! |3 N/ y8 b6 j9 a
- when is64BitApplication then 64 else 32,- o& j& T) \. E- F$ o
- "bit.dll");: ~* G9 w( e& P$ h8 @# y1 G- i
- */) M" ?8 B% L/ }1 e
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";+ B$ G! v) R- b$ V. o$ e1 Z
- local j := loadLibrary(file);4 Y/ u* a9 X! t( Z- {% r' U4 d u
" c1 Y+ ^: C' x# j- O- if j > 0 then
% m5 m" u7 W. f5 H/ v6 x! v - print getLoadedLibrary(j)," is loaded.";% X9 z/ d9 g% L
- 4 q! h0 i G( {/ [
- r := callLibrary(j, "calcSin", PI/6);# `. w/ b5 F# R7 P0 i: e% u( X
- promptmessage(to_str("sin(PI/6) = ", r));! Z, p9 m1 O( B& N( `* p4 S9 M4 o
-
; M, Z; P) ]! g" U7 f2 C2 R* ?$ R - local str:string;/ S# o) _ H* [3 u% j* G$ A; I* i
- str := "I'm OK!";
/ U: o. v; o) p2 a5 S- ~2 Z - str := callLibrary(j,"resetStr",str);; n/ J9 U4 P; y0 ?
- promptmessage(str);
$ E9 B1 x% d6 s3 X( S - $ Z1 ]1 S9 T: ^, _
- callLibrary(j, "listAccess", Tablefile);
! H- D: N- Z* [2 ]% Q" D -
9 \5 I; _) \. j2 M. ^& |$ Y" k - print "Unloading: ", freeLibrary(j);
6 N5 V% g: q. q( G$ a0 r - end;% Z* K5 @- T2 |# {5 F# R
- end;' A6 t6 I+ D, s- F4 N
复制代码 |