- is
" J, C0 I; L7 F0 X7 f9 Y3 B* L - r:real; file:string;
* B) }: K" J$ @# O) g - do
9 @. E+ o9 k7 |& O, K - openConsole;
# W% Y8 C( v4 j& D
+ X2 k+ q5 E, S7 Q; `! E* R/ B- /*
- _5 o* x2 f; T& | - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
6 P0 O4 j( g# x, l( k0 L. V - when is64BitApplication then 64 else 32,0 I3 ~' W; `* V( D2 q
- "bit.dll");
6 O Q4 M& I( Q( j8 w - */
: B% V; `* b/ d* \' m6 _. s - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
+ L- O. l/ `2 e) s+ H7 H - local j := loadLibrary(file);
; n* `- f4 G3 R - ' W4 Z' P2 ~* s: Z0 d, H
- if j > 0 then, e4 E: I5 h: [1 G @* r
- print getLoadedLibrary(j)," is loaded.";
8 M9 x5 w$ y' v6 |1 N
; i6 h. n( w A0 Y# s }- r := callLibrary(j, "calcSin", PI/6);
8 X' B5 @& |) ~# Y - promptmessage(to_str("sin(PI/6) = ", r));
% P- k: Z7 }8 {# v: ~. T - 1 A6 g' N9 {" p: T9 T
- local str:string;
- ~6 }: O$ M- C2 k; e3 [ - str := "I'm OK!";
3 }8 h# Z4 i0 `- k4 G$ A% u - str := callLibrary(j,"resetStr",str);5 r2 D4 U" U* ~
- promptmessage(str);) ?2 o6 |" b7 ^7 b( h
-
4 W6 ]# r6 l+ j# U; P- G# Q0 F - callLibrary(j, "listAccess", Tablefile);
5 Q( N' z+ X! }9 A -
6 l; Y% z* G. J7 y! ~ - print "Unloading: ", freeLibrary(j);# y3 l+ Y4 R. H- Q2 a
- end;" r3 g, H: I* ?& v6 B/ _. d
- end;0 W2 M" X5 d3 a* l |( Y3 W$ b
复制代码 |