- is
9 j2 y5 D+ N$ c/ f0 R: b - r:real; file:string;" L- ]9 Y: A @; z8 i7 E* z8 O' ]/ x
- do
- `" ~. h$ G4 p2 k( T - openConsole;! n$ X8 {' D# J6 b i, {8 @
- " C7 o! o1 L0 J; t: a
- /*
m& a0 t& E: C- e# [5 G - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
1 V e9 u2 n* r; g; `3 r8 k5 | - when is64BitApplication then 64 else 32,. c0 k+ u: H& [: ^( Z2 j! r
- "bit.dll");
% F8 s. p+ [$ B; B! P( M# c - */
8 A, L* v* q* ^# n6 I6 F - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
9 Z# B& _$ I `2 q- s( A- ` - local j := loadLibrary(file);
0 D8 Z* L1 @0 ]; s% o - ) |9 ~; B8 h/ |7 h$ \; z
- if j > 0 then" l. B, X0 L% [7 E
- print getLoadedLibrary(j)," is loaded.";1 Q. n; E/ _* y# k/ ~
0 ^( a3 ?/ G/ Y. a( S3 g; v- r := callLibrary(j, "calcSin", PI/6);
0 x! w: j1 v% {- L9 \% c+ j - promptmessage(to_str("sin(PI/6) = ", r));
+ ^9 W, i6 p: j' E6 ~; B! p -
t+ A6 s+ V' B [ - local str:string;) j# Q/ n) E; [3 S3 M( r y& M
- str := "I'm OK!";
4 ?9 c# p3 q5 ~' E' a - str := callLibrary(j,"resetStr",str);3 e9 Z1 S l1 A
- promptmessage(str);
O$ F7 ?7 i& o4 _ -
+ P/ |* W4 F) D0 j/ m- w/ x' z - callLibrary(j, "listAccess", Tablefile);
5 j: d J! h, _4 o - ' X/ ?" }$ @1 Z! W
- print "Unloading: ", freeLibrary(j); F$ _# ~$ x; h; ^3 a& G
- end;5 c" n( @: Z1 L/ j, K3 P. d
- end;
" w0 r! {6 u% r9 \
复制代码 |