- is$ B( |3 o0 s5 M0 A; o
- r:real; file:string;7 P7 F, [- c! Z2 s, X+ U+ y! X
- do5 [. Z( `- Z) R6 A" I
- openConsole;
6 }0 u0 q: j7 q& D6 } - , U5 s8 N6 a+ W e3 H; ~
- /*
# B# N$ T/ n, {$ Y7 Y7 e - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",# F# ?3 n& I! ]( t% D
- when is64BitApplication then 64 else 32,
- y4 q* E% }: T+ s" Q - "bit.dll");
% \2 ]& m) i0 m: E" h4 W, _ - */
$ C4 x5 ~- o/ ` - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";7 L# {9 \' |6 R7 o6 v% V( A
- local j := loadLibrary(file);
5 v9 f+ r% u" |
8 X( Y1 e! E1 I- if j > 0 then
" |/ H2 D4 y" `# ^ - print getLoadedLibrary(j)," is loaded.";
, n; l( Q8 [- i/ E
- ] W. s$ ^+ `; Z- r := callLibrary(j, "calcSin", PI/6);1 U- ?. B$ y: e& A. A$ h' ]
- promptmessage(to_str("sin(PI/6) = ", r));! c' t v9 d) O' p( L; p3 U# S: }
-
1 E, }# r; H+ ? - local str:string;
/ \5 W2 V& t* A, d2 `, T! R - str := "I'm OK!";
: Q4 F- K; O, H8 f# {# { - str := callLibrary(j,"resetStr",str);
- w! D* m" h3 P - promptmessage(str);* u* j: W+ n- o' O! f0 U
-
2 Y% A& i8 H2 \; l" z1 U - callLibrary(j, "listAccess", Tablefile);
) s. U4 e7 b0 F - 4 M9 ^/ A" w$ s& R5 w. R
- print "Unloading: ", freeLibrary(j);
7 v$ `& i1 X; O, }, y - end;
+ B9 j* Y* T& ?5 N# Q - end;* c2 @3 V3 g5 T9 u8 u) s/ a
复制代码 |