- is
1 K1 x8 r$ H, X+ [; M - r:real; file:string;& k) y7 L' U8 L9 q0 K5 l$ l: c# Y
- do7 `. J" h+ K! j2 \- N/ X
- openConsole;! `# x& U: }8 P. C) q
: B( Q: [. L6 I8 Q% w: l. ]8 w- /*1 S3 g$ P7 C2 W' M, M1 j0 k
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
( q/ w+ j2 ^' }+ U: ?" v5 t - when is64BitApplication then 64 else 32,& M' k+ G/ C7 d! j4 U. A+ w
- "bit.dll");- J3 M% ], o" e9 n
- *// r2 ? ~( H+ t0 V
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";+ \4 c! u; M" C( a& w; k: Q" v2 C
- local j := loadLibrary(file);
; \& h/ N2 v) _& E5 }
" b& G& R% p* J& q+ M- if j > 0 then
. d2 c6 e7 X6 N! H( E/ e - print getLoadedLibrary(j)," is loaded.";" ]3 ^5 d" `. |! z
- 1 J! }6 o6 U4 E, K4 v5 w
- r := callLibrary(j, "calcSin", PI/6);
+ o' l' f+ H+ M" f - promptmessage(to_str("sin(PI/6) = ", r));
' B0 ^, ~( p J - + @& B2 o; Z. o
- local str:string;* G9 q. W* T0 g: f1 M/ I' j
- str := "I'm OK!"; x$ }8 V* n; {, T$ Y
- str := callLibrary(j,"resetStr",str);( M9 N# {9 P B% E. q
- promptmessage(str);! d$ N- f, R% o, \' P
-
7 A! E( V' H: n* x' S! m - callLibrary(j, "listAccess", Tablefile);* g# M6 [0 {8 Y* ~! V
-
5 N+ V) ^8 l" X; g2 M% @" S - print "Unloading: ", freeLibrary(j);. V/ s/ p0 ?' A, P
- end;
( z# O( o, x. `6 J - end; n, `0 i# v( L# o! A
复制代码 |