- is
6 D1 J1 M7 U- U X2 s+ U& @ - r:real; file:string;
7 s6 o! [, ~# z6 U - do
( H& o. ~8 G& J* _* i4 F. i - openConsole;; o# N" x- F) f; y7 W* d
- ( O3 k( Y: M8 Y K
- /*
) K4 n/ }# H$ h - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
5 n1 r0 I% A; r6 R& i. e - when is64BitApplication then 64 else 32,
* j) x+ ?. i$ _: V, r - "bit.dll");
. \4 r6 ^! }6 ~0 p5 {, J7 D* y+ W - */3 D: C: U& b7 [0 P
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
2 e3 R% q& I1 I7 l% }0 e - local j := loadLibrary(file);9 ^3 S: F B4 Z* r
- " j7 H- M# |! k5 C4 `5 {7 p
- if j > 0 then
+ k$ q: {/ S# W1 J - print getLoadedLibrary(j)," is loaded.";, y& w2 g! B- H B1 R; M# G1 J
: h/ T3 }$ ?2 K l" ~- r := callLibrary(j, "calcSin", PI/6);
4 H1 u9 L; \% H$ a3 ^7 U - promptmessage(to_str("sin(PI/6) = ", r));
+ `( h+ B5 A- y/ G0 P( M -
4 ~- m+ f/ R9 k0 R6 p7 e/ J - local str:string;
1 H z; a3 Z& u7 i8 Q3 v - str := "I'm OK!";7 H8 ^- |. G Z$ ^+ | W, p$ L
- str := callLibrary(j,"resetStr",str);# q: T/ ]/ B9 z* j- x' D# n: R- h
- promptmessage(str);
1 d$ q- G9 N6 M( b- p - 2 {) A3 f0 t$ [+ V0 @" Z
- callLibrary(j, "listAccess", Tablefile);
0 j7 w- H# M- g! @3 M& G! r! w - 4 _$ V0 j: W0 d
- print "Unloading: ", freeLibrary(j);
4 J9 a w4 T, z' X1 _' R; z3 D7 ? - end;
k( L: d0 j1 Q5 W" p1 N - end;7 l* s- _/ q6 I1 a
复制代码 |