- is
. w8 Q2 h$ H; z - r:real; file:string;
3 _. c- w+ C1 E/ Q" i - do
* v3 L) s7 L: _! K - openConsole;$ c8 {! v M, W
- ' G+ I1 R* L* y5 s
- /*
) J# F6 x1 n4 l# | N7 k6 R5 G - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",1 C6 O: d* S( z$ _; q+ _ G5 z
- when is64BitApplication then 64 else 32,
- m. c/ |2 J* ~& q2 c: V" O - "bit.dll");: Y7 H$ W: E, S! h+ K" w+ ]
- */, Q' v8 `# R2 F) u3 b) e
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";) D. [. m. z9 n
- local j := loadLibrary(file);- l2 V* z! `$ [: o
- ( `. [- n9 y- [( H4 t
- if j > 0 then
% i: w3 w+ H' @* L: p, A$ c8 z: O - print getLoadedLibrary(j)," is loaded.";
% d! v" B U( d - . K, f2 U. u/ c; Z d4 j( b0 P
- r := callLibrary(j, "calcSin", PI/6);
: u0 d1 y" L7 l. y/ G6 B& Z0 ^ - promptmessage(to_str("sin(PI/6) = ", r));: m+ k9 L( A4 f3 `1 Z
-
& b' t7 [- \4 d - local str:string;# ]* y. @% R% q8 Z# m W6 ~: W
- str := "I'm OK!";
( J( m3 g O/ R! u9 V - str := callLibrary(j,"resetStr",str);
" E+ @+ T+ h- U. _( h - promptmessage(str);
; y& ^, }% g8 @9 g -
6 o3 d5 I2 a7 L3 V4 x - callLibrary(j, "listAccess", Tablefile);
" m! h0 r% c$ F6 Z. a6 J - 1 K8 ]1 _/ }) x
- print "Unloading: ", freeLibrary(j);
5 l( r4 I: b7 K/ Z7 Z - end;# S" n5 q( g% Y
- end;" _2 U8 L4 }8 E
复制代码 |