- is
% E6 D" X8 z5 X - r:real; file:string;0 V8 q; e9 F$ _. X& ?
- do
- q/ x3 U0 z _3 k A - openConsole;) b: p* b6 p) ^$ _
- 2 M+ F9 D# \* o4 e
- /*+ ]. |* t5 q9 ]! M5 g7 b( ~5 N
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",8 ~. w6 C/ C4 ?5 q
- when is64BitApplication then 64 else 32,( W, a6 F7 l( Q
- "bit.dll");
2 I- W1 v& t; s; ^6 P. x% p+ u$ p - */
8 y5 z1 Z" T2 M- S& w - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
. M/ W d, b' U2 L" N - local j := loadLibrary(file);; d/ N4 t- u9 [, ^# z! t5 n
2 f' k9 m" i5 N# r# M2 {- if j > 0 then
5 O* Q8 X# E* b2 t - print getLoadedLibrary(j)," is loaded.";
. X% `/ o$ E3 y. X - : h, j: N0 ]1 B! C; i& a D" C
- r := callLibrary(j, "calcSin", PI/6);
9 @7 n( n7 M* l& M - promptmessage(to_str("sin(PI/6) = ", r));8 J& G7 h2 }, {) D6 h2 J
- D8 { w$ G$ q0 c( y3 z. N$ _
- local str:string;
$ T3 r: _: S+ @4 \/ n2 t# g- g7 W - str := "I'm OK!";
" i. Z- c4 ~8 Q7 x - str := callLibrary(j,"resetStr",str);1 P* K1 p! j, Y
- promptmessage(str); f$ i8 E' N0 R* q! ?# \$ Y
-
/ N& g/ u- w5 }4 X7 f7 Q1 O - callLibrary(j, "listAccess", Tablefile);
9 ^% T Z# J' J. y - * f c% {' Z: J% w z$ u# x
- print "Unloading: ", freeLibrary(j);
@' `" n/ b: _/ B - end;1 z' d [1 ~( |
- end;) y8 s: G- M; s. b& @
复制代码 |