- is
% g' ~; n) [" J2 F/ t% g - r:real; file:string;# C3 \+ S* \3 M2 f& b5 `
- do
, d% _; g* C1 l9 c) w; s - openConsole;
1 g9 j8 Y: `3 M% N - - {) r5 H& f" L/ r' K4 a
- /*/ }. q5 C+ W, z& r
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
5 {! V7 r0 B* n5 K - when is64BitApplication then 64 else 32,
7 s3 f, l- ~) @6 g$ G4 B' \ - "bit.dll");
. T% ~1 U) n, _+ e8 K+ i+ n - */. n* m( q$ i: x
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";( {" P: d( I! A* m( G+ q, [
- local j := loadLibrary(file);
( w8 u# }( ^. E/ o
- m M$ T" E, F- S# }' ~- if j > 0 then1 y/ S. d: n* h
- print getLoadedLibrary(j)," is loaded.";' y7 g3 Q# S* O% R6 p6 F
- 7 a5 t8 C6 R! M
- r := callLibrary(j, "calcSin", PI/6);/ v; Y0 [1 j" E+ `) p. Q
- promptmessage(to_str("sin(PI/6) = ", r));
/ j$ i H9 |: v D! G9 n+ I& u; ] -
1 p7 |" i7 _( ? - local str:string;
Y) G# j$ H2 S - str := "I'm OK!"; R, z/ Q- B( z! d; E2 a
- str := callLibrary(j,"resetStr",str);% g/ D3 R% }# y; E6 _+ W, U' E. ~
- promptmessage(str);
) C! o v: v8 _' }9 i7 \5 Q -
: d9 E4 h' p+ F - callLibrary(j, "listAccess", Tablefile);
$ F0 z! U" P9 h, r# ? -
. a" U3 Z/ I7 K% Z+ t$ @4 }7 | - print "Unloading: ", freeLibrary(j);$ B2 V; M% R/ T# ^
- end;
$ d0 x7 m6 I j, ~ - end;
: W5 n) K6 D; Q8 h! Q9 V# \% j
复制代码 |