- is
. f7 o1 s0 I7 f+ b - r:real; file:string;
K0 N; }$ I! z- y" Q3 F4 H" R - do1 B& C1 x. A; C, h
- openConsole;
) q; c2 m. J! q# L0 A6 Y - # w$ @% z% ~: p0 Q$ t- g
- /*
: S& v: x5 x+ X# v" _% f - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
: Q% ^; g( b. Q, u" j - when is64BitApplication then 64 else 32,
1 O8 X; ?4 N" ^& \. T0 d7 x2 j, u - "bit.dll");* J; Z0 m3 E. C2 i& F5 d) Z
- */+ e& \1 [. e& p% j8 i
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";8 p! K7 ^: }- y3 ~
- local j := loadLibrary(file);
7 n9 G* R! t, ^( e1 v - ! W* I3 g/ L; r" Y" Y
- if j > 0 then
1 p: p; o! f4 K! K6 k - print getLoadedLibrary(j)," is loaded.";
, ]* k6 T7 V9 o! Y
; m7 [- S- t. G4 p% p, y+ |- r := callLibrary(j, "calcSin", PI/6);+ E/ l" z1 K' O
- promptmessage(to_str("sin(PI/6) = ", r));
: P! y6 S* ?( M* l( Y! l! r -
& J2 L7 L* c. R& B; y3 b - local str:string;
7 A2 S! j) l t1 ]$ W1 N+ ] - str := "I'm OK!";0 u; [! H- G) n
- str := callLibrary(j,"resetStr",str);$ z/ a) j# ?* ^0 X7 o/ D: A
- promptmessage(str);
: y# o8 J. A9 P# J) d* i -
% k* \" X. u: E1 k0 _( |, O - callLibrary(j, "listAccess", Tablefile);
) ]3 c5 ~ ^0 b8 u2 ], t5 A9 T -
( A% d0 F% z$ t2 R; }( |4 Q1 d - print "Unloading: ", freeLibrary(j);
9 {2 s- t B3 ]3 u! e: Y* T - end;* g- q( c* J# n6 t* }
- end;
* ?( R) R* }' e* k( Y' U
复制代码 |