- is6 K1 {* o# b; b8 T; m
- r:real; file:string;* G9 j' x0 c3 |- J4 f) k
- do
$ o+ H# I' M) o5 l" h* r - openConsole;
! ]* z) E& M, u - # Z2 C6 z2 g v H. }3 ^' s0 ^/ G
- /*
! S: `1 M7 M) u$ o# r- k7 s. f - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
+ z" a9 Z; e% m3 _! d - when is64BitApplication then 64 else 32,
/ `1 |4 N9 p5 T - "bit.dll");+ r' ?8 [, m: }7 ~
- */2 V7 j* S! f% T( n/ S/ J8 |
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
9 Z# J* A" u% d* u# P, l - local j := loadLibrary(file); ?" s( X( N; _1 M2 n
- 7 Y3 S1 S# E1 t8 ]6 A
- if j > 0 then9 e2 n8 B! F5 }' i" t7 @8 W+ t7 A
- print getLoadedLibrary(j)," is loaded."; e2 Z+ F% U9 X- `, V* O' h1 A
- 5 J j9 O( P! r: f* K: D
- r := callLibrary(j, "calcSin", PI/6);; b! N- ~! j$ V2 U ^; @6 A
- promptmessage(to_str("sin(PI/6) = ", r));
: _% x4 I& I* I9 [. U9 | - |/ ]$ ?( h2 Q; S2 y
- local str:string;2 P5 u0 m* n! f& C" Q- ^
- str := "I'm OK!";8 v, K8 Z9 y: _5 x# E) K
- str := callLibrary(j,"resetStr",str);2 X% ?8 B: d( W/ v+ C
- promptmessage(str);+ ?" S* ~+ y+ U, ]0 N g% N
-
7 t$ }' G6 u/ L: q) L9 U - callLibrary(j, "listAccess", Tablefile);
: z( [" Y3 x$ {$ U - ; F# V- x# A( d" ~' k6 y: ^1 _; d3 o
- print "Unloading: ", freeLibrary(j);
& u" w( v/ T) {! S2 f) w0 ?7 J - end;
3 r w( s$ d4 _" E: D+ c9 h - end;
% p9 }5 Z* _! K
复制代码 |