- is
) Q( h7 A' Y: x: k9 L/ L - r:real; file:string;! X9 u, f% c1 W, J
- do/ [% e0 {) p8 H. b8 Q8 r
- openConsole;
3 Z7 y0 g2 p! [# S' J
7 x4 M: Q) i; H- ~$ m- /*
. s. J8 W- q" Y% Q% c. d - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
3 m2 }! @+ O( ?- g: l - when is64BitApplication then 64 else 32,
& O- o- W9 x! G Q - "bit.dll");
4 C# c+ S9 h4 n9 _. d - */
+ v9 S$ Y( `+ t* F1 {- L9 o - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";' F5 q/ p/ @! T1 I0 x
- local j := loadLibrary(file);$ c0 i% f) X# D& S( }4 ^ k
* P" J0 C# b+ Z- if j > 0 then
) n/ N& f& z- b [7 G* Y8 y - print getLoadedLibrary(j)," is loaded.";0 H# F6 T0 q( u: P! M
# W! N7 m1 Z# f2 e/ \; r- r := callLibrary(j, "calcSin", PI/6);
8 d2 _, f$ q7 r* _5 ]- l - promptmessage(to_str("sin(PI/6) = ", r));
2 v" I& ^$ A" P' t' a -
" F; r1 ^! R0 s& c6 P - local str:string;% Q- u8 W5 w, M, Q: x" l
- str := "I'm OK!";
: n% f3 o2 {. ^- q# P* Y& _: m4 n - str := callLibrary(j,"resetStr",str);; l* u' b- i: I' r/ g
- promptmessage(str);
( k3 B. D2 a5 r" k1 [1 z: [ - 9 l" \9 `# h/ I5 O$ z7 V
- callLibrary(j, "listAccess", Tablefile);: E' K, D8 _/ M+ l) T6 o" N
-
8 ?9 T4 I. W' e+ ] - print "Unloading: ", freeLibrary(j);
. A/ d! i' \$ U( B' y0 ^3 [ - end;- c, E; V9 C4 C* V& I
- end;# q% J5 {# o" P5 f+ p
复制代码 |