- is( }4 f$ h9 `7 z; A) S
- r:real; file:string;, ]' E5 A9 m0 Y' `
- do: I) ]3 o, R- d$ o- g2 j B% G4 u0 U, S7 N
- openConsole;9 E u5 S' R6 L2 `
\2 e1 C% f5 f; ?- /*
8 I4 X( @. [7 `5 o2 z; n - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",4 b; G0 R l6 x& n8 k1 S
- when is64BitApplication then 64 else 32,: q, ?5 \2 i: g* @# B5 R
- "bit.dll");3 ]$ \/ X0 V B5 F
- */
) ^ w' a; s8 N! f" u. q - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";) U* g' h4 _3 [% I
- local j := loadLibrary(file);! l4 y$ f' d1 N
: d5 y1 T$ F) M0 o8 F- if j > 0 then3 G! k/ n# A# X
- print getLoadedLibrary(j)," is loaded.";
2 q4 ]4 L9 n8 J9 ?! E# C( r
" i u% |" g; f S- r := callLibrary(j, "calcSin", PI/6);8 b% X* _# s( A. ?+ G8 @: }
- promptmessage(to_str("sin(PI/6) = ", r));
* i- t7 A; `! }7 W9 y3 f' F -
0 y$ U! {* `) R' s3 }- |, W( P - local str:string;( g+ c8 b! ?6 p- z% T! x% y, j( h$ p4 |
- str := "I'm OK!";0 k: ]) f" ]& Z6 I# K" h9 }! e
- str := callLibrary(j,"resetStr",str);+ m) Z# B' N, o: A) q" `
- promptmessage(str);5 J$ l$ l* a3 \0 x" @! u1 h
-
' |& `& c* N, l K# K9 y( ` - callLibrary(j, "listAccess", Tablefile);# W( ?% S, g2 _# q6 e# h0 @
-
3 e: m/ e, w$ d7 W$ @$ L: T - print "Unloading: ", freeLibrary(j);
. O: S# B. s( u, { - end;
7 B" M( n3 Q: l: E0 k1 p - end;& Q1 Z7 G h) f! ~+ R
复制代码 |