- is% `" W7 @; x& {1 r- `7 k" r+ y7 l5 g; V
- r:real; file:string;' N6 f( C# c% ]+ R
- do
7 |5 X6 Q! [; \ - openConsole;* z2 D, ]9 L" P* J
- 2 A% D3 w) g# X P
- /*
M/ m+ G) l R, N: S - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",4 D; e+ A \, e3 l u0 e; [
- when is64BitApplication then 64 else 32,4 z! N# z `; c
- "bit.dll");
8 K1 z) S0 O D2 e - */6 K# @7 ~+ l6 X& H2 @7 k3 N1 C
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
p0 p P' I2 s& P$ ^ - local j := loadLibrary(file);! J" G) q3 K3 k
8 Z/ l- s2 I! H- _- if j > 0 then3 [; m! V& D+ H; J3 ?1 E
- print getLoadedLibrary(j)," is loaded.";
: Q8 F, e& X' M - " z* P$ k4 _" h# k" D$ ^1 L" I& P% E
- r := callLibrary(j, "calcSin", PI/6);2 c& Z6 O0 [4 y5 t; p% Y ~
- promptmessage(to_str("sin(PI/6) = ", r));
+ ^4 k8 F6 r& M: h) r: M) R4 f -
3 {7 y, C/ L" h, t - local str:string;% p- q; Q) z: e3 w' b
- str := "I'm OK!";1 a0 y8 a. O% {, I$ @& R/ \
- str := callLibrary(j,"resetStr",str);4 u( e7 B% z f# h+ C
- promptmessage(str);2 ~' d3 c1 U1 K4 l6 U
-
- [$ D+ J4 _2 S8 S* w5 @, J - callLibrary(j, "listAccess", Tablefile);
2 R( K4 g& ]1 B" z# } -
" y1 a# V3 v/ ~/ V" Z - print "Unloading: ", freeLibrary(j);" a, j& E% X; q( O
- end;, Z4 l* `6 ~5 K3 X
- end;2 _. k. C8 U( ]' A( c. B3 w4 z
复制代码 |