- is
i) m# I7 k$ O/ a( b" F8 B" z - r:real; file:string; o' g4 y4 r) U' T2 O, W1 k
- do
2 x1 g9 u* n1 c1 P - openConsole;) _3 {; {8 o% }8 @. q
- q5 n2 f Z( ~* S+ Y1 M& Q- /*
5 ^, w5 \. r8 U* | - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
$ M% f* d4 p. D0 p* o - when is64BitApplication then 64 else 32,9 O5 H7 A' c( J: W& k8 |' d. \: Y
- "bit.dll");+ v7 T; Q* K! X- D1 u
- *// A9 N5 W3 u. p, P
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";5 u$ L& r, s! o' Y
- local j := loadLibrary(file);: e* b A& D" J( W
% _, K; [9 S- ~( v- if j > 0 then
/ L0 Y* h1 f: a4 X - print getLoadedLibrary(j)," is loaded.";% F* q5 l: V4 ]% @
3 f+ \6 [" T& D- r := callLibrary(j, "calcSin", PI/6);; _, s. _! `4 @7 x M' o/ @0 N8 d
- promptmessage(to_str("sin(PI/6) = ", r));
! r0 y* C/ Y$ j! E1 ?7 ? -
6 H% z L0 ?% `" ~. K - local str:string;
% y4 c. |% c! P. D7 n! a4 f. }0 Y - str := "I'm OK!";9 c6 ^3 @, A: q u& s
- str := callLibrary(j,"resetStr",str);* {' S/ E3 p; r" h: u$ G- t
- promptmessage(str);
2 j( f1 ` P$ C -
* N/ d9 d+ T8 W- d) G1 k - callLibrary(j, "listAccess", Tablefile);/ h9 S5 p% k) }
- 6 i7 T$ d1 m2 U2 H% O3 G4 L
- print "Unloading: ", freeLibrary(j);$ ?0 Z# L9 b' F3 X
- end;3 W$ ]+ f6 B) g3 C& x, l( \' y/ j8 ]3 K
- end;
1 J# d7 s( p9 {; L L
复制代码 |