- is2 }4 i) X/ X, g, {& g6 p# q
- r:real; file:string;
6 U% I% C7 ?+ i" B1 q( j - do
3 E7 c. ^, D( @! h8 S% H - openConsole;
# \5 h0 x4 }" ?! b( ^ - 1 o1 t+ H( P9 w1 X
- /*
e m8 d8 ?+ n# y; c5 X - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
) d; E2 @* i) d$ ^% K, _( s - when is64BitApplication then 64 else 32,
! e& ?0 D c- m* p6 A# B - "bit.dll");4 C O7 o* N7 C( b1 k" O% F) Z% U
- */ L. o! @6 w6 o% F! ~( O
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";! o: m% G, I4 X$ ?0 A' i8 P
- local j := loadLibrary(file);6 M; L5 B4 l; _ x2 Z) Q
- 2 X3 ]# \' B& i' u L1 N8 i
- if j > 0 then a! \2 i1 r! l$ S- _( z
- print getLoadedLibrary(j)," is loaded.";. m( l( m# e+ E! `+ Q* U
- 9 t# P8 F" x+ J1 k
- r := callLibrary(j, "calcSin", PI/6);
% ~0 A% D2 o4 h/ o& L - promptmessage(to_str("sin(PI/6) = ", r));, B9 N8 K \* u* y& n! F
- ( t* a, t+ `& w, z
- local str:string;
) ?# G7 D6 O7 A2 E1 D5 r0 K - str := "I'm OK!";
' C6 D H- g+ D( g8 `7 R1 h - str := callLibrary(j,"resetStr",str);
% P r: t. Z! ^2 f* } - promptmessage(str);
7 B8 H2 O! I) u* {. e. I* g1 Y" K - & [1 h0 S; k( [4 F2 x" ^' V- h
- callLibrary(j, "listAccess", Tablefile);
+ [( Y$ v1 `1 `$ |. p; l -
) D; R7 [7 Y W x6 z: x - print "Unloading: ", freeLibrary(j);
; I: H m$ B# P/ k2 f2 i. f - end;
4 J! X8 N2 k. s b j7 t) q - end;
, D5 m* L: _! S/ V( o6 [" S$ K" A
复制代码 |