- is
, A! w9 _ V9 _9 Y' ^ - r:real; file:string;
& I ~, u8 Y9 D/ i" c l - do
. }* [! A9 t; m2 N8 W - openConsole;
. J, y; e: G! f - . B# I* v" [/ v6 W9 j" `
- /*$ t7 w& `& e) \& O/ K
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
* b1 S0 a; Y p+ e$ R7 j4 a: i - when is64BitApplication then 64 else 32,$ Q, s! \/ J* ]3 z5 j/ I
- "bit.dll");
- N" z! t% q% L - */
0 h) d7 O. u# T* j. l# X" Q8 c - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
. v* A0 t9 V0 E2 H) D8 c - local j := loadLibrary(file); Q I V5 g4 Q# ]7 W: ~/ @. R
- 3 \- Y' q1 n' D2 g+ m8 T! v2 m8 A
- if j > 0 then" G+ _% c2 Q3 F' t! w
- print getLoadedLibrary(j)," is loaded.";
6 [: \8 K4 K. G6 V+ G
, l- I5 s5 \% M) k, t8 b1 G- r := callLibrary(j, "calcSin", PI/6);
5 d; J# r. X" b, X* b - promptmessage(to_str("sin(PI/6) = ", r));
, A) P0 C( Y4 J7 k1 s( Q- [) K -
5 ] q) y# x: T. B. ? - local str:string;! s2 [/ ?. y8 H4 P9 X
- str := "I'm OK!";
4 f( v$ y/ k; p - str := callLibrary(j,"resetStr",str);
& D, W( O3 |8 Z7 f" r - promptmessage(str);
+ i7 k! r3 `8 t/ H* N2 g- P - * D7 h8 V( M$ F: _4 H7 q, ?
- callLibrary(j, "listAccess", Tablefile);
) A0 W: u% H- Q; o0 Y - & a! T8 H' h& c: Q4 k
- print "Unloading: ", freeLibrary(j);
, j: x' a- l$ s! j - end;& z! H- L3 P. P
- end;/ ]( R- I( `4 ~; X) z) j
复制代码 |