- is& b) @* V8 Z. s' w% r# o+ i
- r:real; file:string;
: I* G' a) e* `" I) C1 | - do
4 w: I5 M9 ]- s8 f+ F$ S - openConsole;
) p2 W9 \; D4 A5 b& M - % S2 b- }6 I( z8 E5 ~, L, }# e! Z
- /*
% P; [% D1 g7 s( n! b9 N - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
a- ]1 M3 q1 t7 r2 F* B, S - when is64BitApplication then 64 else 32,5 X( w1 Z D" K' t/ w' |
- "bit.dll");
0 N X7 L$ s6 n6 a7 p; u I" v - */" @7 E% J+ r$ M$ _+ A
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
9 T: b% D* |/ ^5 V - local j := loadLibrary(file);
/ k; v$ a, k$ h
" f8 _, @) T& q" T- if j > 0 then. ^2 [- |5 @1 a. p$ @8 T: M# D
- print getLoadedLibrary(j)," is loaded.";$ w4 U8 j3 f* x9 d: H: ` Q2 X
- 1 h( Q9 a: X9 e4 h* ~$ G' a4 `
- r := callLibrary(j, "calcSin", PI/6);
$ d: h6 M7 v7 C# o% U& e! i - promptmessage(to_str("sin(PI/6) = ", r));
6 C: Y) R, v) q -
0 U( U# r% k+ } - local str:string;
5 o8 @0 S) B m/ D2 ?4 [' h0 ~ - str := "I'm OK!";
& ^( D' z( Z0 F+ `7 Z; h - str := callLibrary(j,"resetStr",str);
3 Z; b8 }: c- Z1 Y6 y - promptmessage(str);
# `, k; F3 f6 l) V -
Y& h4 R9 d, [5 b - callLibrary(j, "listAccess", Tablefile);
, j( q# G/ A/ K. } - ) o, R& d( i1 ^+ z# R' m
- print "Unloading: ", freeLibrary(j);* |9 f4 o3 C. m- q, x0 e/ l
- end;0 k0 y+ {+ X0 O, d+ Y, A
- end;$ I9 t+ K6 p/ t: u$ L0 E I% S
复制代码 |