- is
* e+ o0 w; e" l - r:real; file:string;* y+ T3 J4 }: [4 t2 N+ U
- do
8 v- k; m( b7 ? - openConsole;
* o: |2 R, A8 C# s3 M0 d$ |+ |0 d - , V3 \: `$ \; x7 H% e6 g9 \4 w
- /*
& p9 b& Y: ~6 M. j% g% C - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",& [" n3 l1 ^/ E) g& m( @! X
- when is64BitApplication then 64 else 32,& t( E8 C4 A2 g; s# x: u D7 ^
- "bit.dll");4 m& H6 ^4 l8 ]0 @) T- |, i: _" m
- */$ h& Y c" S9 Y6 c; t, G8 P
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
: ]" I! r0 s3 b1 m - local j := loadLibrary(file);4 J7 K4 O+ F4 i9 ~
- 9 k. \2 i$ g) [9 q1 S
- if j > 0 then0 G4 G8 X5 u# F0 x" P B. M
- print getLoadedLibrary(j)," is loaded.";3 Q/ ]% A! k1 Q6 R& i
! ^1 k: v. ~; j# Q# @& A- r := callLibrary(j, "calcSin", PI/6);* t! W+ G8 Y& w3 Y
- promptmessage(to_str("sin(PI/6) = ", r));
. o' d8 i# _( ~, j6 O; C/ M - # \+ e9 H: \. _ Z7 k1 v, k
- local str:string;
0 D0 K( v+ a: }/ X% @ - str := "I'm OK!";' D. x" P# G5 N$ ^) Z
- str := callLibrary(j,"resetStr",str);
! f$ m! J6 V, K( S+ b - promptmessage(str);
4 w5 l2 ~) z, U - / v- I$ e6 {- M4 s% o$ c1 n. Z
- callLibrary(j, "listAccess", Tablefile);
0 O- J% c+ i* C% h& [ |% f ? - - t8 E5 ]/ X1 r; N, Z& d
- print "Unloading: ", freeLibrary(j);
; D9 o, k; Y; A/ |2 c7 v; j - end;& Z% n: ^. W0 v% {3 C
- end;' j3 J% e) A7 x5 p- w+ _
复制代码 |