- is
6 A$ E2 h I5 g9 V" I$ D - r:real; file:string;
" h) h* _/ O* ]% H$ ~ - do0 w+ J9 @ G' m' K y" k6 {- _2 h
- openConsole;
! U# k d4 ]5 ~; [! H - 8 f& O% ^; x2 L1 d3 V( L4 |3 q
- /*
& s" A* l; l, z: t- e1 E5 } - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
8 X3 M( f$ i1 |( Y - when is64BitApplication then 64 else 32,' p3 R5 V. U- ]1 |, h+ p
- "bit.dll");4 k6 i) d. S1 u
- */( o/ y: L% X4 C) x! r
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
. E" y. ]' M2 ~( E - local j := loadLibrary(file);
- P" F' y: u1 H/ s
$ }, Y ]6 C' @+ a+ P7 O- if j > 0 then
\* c# Y+ f1 w3 r" w0 ? - print getLoadedLibrary(j)," is loaded.";
W9 D( f. _% H - 4 y' c( c' m. G8 P4 b9 u
- r := callLibrary(j, "calcSin", PI/6);$ o! L! K7 r" |
- promptmessage(to_str("sin(PI/6) = ", r));5 ?$ c% b0 Z/ P _
- ! R" R/ x% s( b) t
- local str:string;) D( ~% G9 x; Y: C0 L8 e
- str := "I'm OK!";& m' ? o4 ]$ D( m# Y
- str := callLibrary(j,"resetStr",str);
% ]4 t# i: {! K* \; s% u - promptmessage(str);4 C3 r: x( n6 T3 s, v4 A3 {; n
- k0 x9 {8 N; r4 V
- callLibrary(j, "listAccess", Tablefile);
. S: w( c+ D( { -
/ k: c% [9 N4 G$ S1 d1 c - print "Unloading: ", freeLibrary(j);& l1 T' m n7 _7 R# ]( |5 U l; O
- end;
( L$ e' `+ p+ {8 b, O - end;7 j# v( R- w3 V$ P
复制代码 |