- is
) L6 U- L5 Z9 X2 K- B - r:real; file:string;5 j4 p0 Z+ B% v9 U$ G
- do6 e. j$ n) R( z) [6 i$ a6 F
- openConsole;$ Z; {3 f: V- P" R& ~- z6 E
- ; J* E. H0 @$ |+ h1 a' S
- /*
1 y$ W) m9 ~3 Y! ?8 J) P - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
7 `4 E1 G' b v, K$ h - when is64BitApplication then 64 else 32,2 ^% A& ~) J" A% b1 M& A
- "bit.dll");
# u, U5 G/ ]0 T2 x _0 k) s - */
0 T6 l1 h3 L) w - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";- \2 w: R1 g' _4 x: [
- local j := loadLibrary(file);
3 M& t: i+ q3 W4 ]8 p
8 n& Y0 M% U# X- ]" H/ t5 r, m- if j > 0 then
- I8 u! I! p/ a- V! }3 G - print getLoadedLibrary(j)," is loaded.";: v! H6 r/ N7 @
& _. l0 @, N* a' j- b+ n2 [- r := callLibrary(j, "calcSin", PI/6);% k& @; j4 X( T: l! |+ Z: l& R% G U
- promptmessage(to_str("sin(PI/6) = ", r));
p) u; I: \9 s: B% ] - ) A" Q) n f3 ? m/ {
- local str:string;
1 V# f" K' n5 q9 J# R. } v - str := "I'm OK!";( w3 i+ l$ t9 ^1 }+ a6 S
- str := callLibrary(j,"resetStr",str);
2 U6 _4 Y. U) M2 P/ p1 V/ X - promptmessage(str);
; }5 |( L% i/ j2 h, z' x# C - 0 X2 L+ k7 l1 L( S$ w( n, p6 A/ S
- callLibrary(j, "listAccess", Tablefile);
* Z2 `7 n, Y, O' [' }, A -
* W! o6 L# Y$ X8 I) l - print "Unloading: ", freeLibrary(j);# e! \ p) ~& `( Y( y& T
- end;" w4 B" W, y- v5 a/ W
- end;
% q/ h3 V" q) u' A1 Z/ z
复制代码 |