- is
+ ]2 D5 [8 y% H, W! I! J - r:real; file:string;
' ]2 f, u7 B2 s - do
2 P: ^" A4 O0 N/ ^' v0 k8 V; O - openConsole;
( ]4 @- N9 _7 G% t! v2 O - 7 L# a, p1 ~' _, L! S8 v
- /* X/ W7 i. c# N% ^! k
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
, L% C& D/ u8 L& Q% U5 v - when is64BitApplication then 64 else 32,% C. t) ~1 l+ v* H2 U: u5 f
- "bit.dll");
$ B' M! @2 d2 U7 l9 i: | - */( v# g. }4 W5 d
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
/ U, X: _0 ^" v* \2 f - local j := loadLibrary(file);
7 }' g9 h8 i6 l) K
' d+ A* _, M' M, ^* [6 V" F- if j > 0 then4 d( s v3 t! p1 f2 x) j
- print getLoadedLibrary(j)," is loaded.";
, ?2 [& w, i6 K
+ [; S, O* w- s- r := callLibrary(j, "calcSin", PI/6);
) {: Y2 Z: n9 J0 J [, ?, B - promptmessage(to_str("sin(PI/6) = ", r));
9 [9 R4 K0 N$ s) w -
/ A# y: w) k8 E: i( v, ]. D3 X; S - local str:string;
4 l" _: _8 I: ? H - str := "I'm OK!";2 L" H6 R7 c7 v7 ?$ l. [" v/ T
- str := callLibrary(j,"resetStr",str);! Y! g4 E* Q/ {, i
- promptmessage(str);
0 L# I" E, O; C - 1 M8 s% j0 e& R9 d- y
- callLibrary(j, "listAccess", Tablefile);' p8 g4 e3 p, Z0 x
- & V4 [% I/ z9 _3 e$ g! x" x
- print "Unloading: ", freeLibrary(j);
8 }) c5 h7 y, a2 w0 G4 O - end;
1 a/ i# p% }7 F4 }7 n" K8 u - end;
7 O6 ^+ o6 m j- ]1 ?
复制代码 |