- is' z- H1 I& ]# i0 N9 X" X6 s
- r:real; file:string;
& K4 e) \# x( f0 v2 B4 d - do. Z" R: o6 C3 Z$ G9 k- X- q& k
- openConsole;
! m7 a" ]* ^# \2 T, g! O1 Q - 8 r4 r6 K8 [# I6 E9 z
- /*
& u: z6 |* |- ~* k9 E1 D: U- Y+ B - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",) E+ W; A% |) f4 x7 X' l
- when is64BitApplication then 64 else 32,, J+ F- f5 p3 l- ^5 b
- "bit.dll");9 ^0 v5 Q" u+ k4 s, q$ E/ z) U
- */
2 D* p/ l/ Z- E0 h6 G/ n3 s - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";5 g- g$ o, S1 N3 C
- local j := loadLibrary(file);4 f z% ^1 A% t: b2 b8 R9 a/ n) t
: K8 |$ f! u( t+ N1 s' f- if j > 0 then
/ @- a6 v3 K" Y6 D9 R4 l! H - print getLoadedLibrary(j)," is loaded.";
. D: ?3 ]- x) B: h3 T; b9 L
$ [: z4 v4 l1 }3 r; F- r := callLibrary(j, "calcSin", PI/6);
- A6 j$ x3 p, J$ t4 A - promptmessage(to_str("sin(PI/6) = ", r)); P# {8 H; h3 X w
- % d+ M! A6 Z6 s7 [2 G2 l
- local str:string;' {/ F" ?6 H# k, A! q$ }
- str := "I'm OK!";
8 N2 ~8 L2 X @. M4 _, h - str := callLibrary(j,"resetStr",str);& `4 u& B$ F+ x% Q* [. o7 n9 U/ t$ _
- promptmessage(str);* D4 T! x& p1 y B4 s; R' e
-
6 ?, \8 v4 w4 `2 Y% D1 B - callLibrary(j, "listAccess", Tablefile);6 f8 I% r; m2 Q& q4 g" H3 o# P1 S
-
& c* }* U3 s: V8 h6 U- t - print "Unloading: ", freeLibrary(j);. p2 i0 z0 c* W8 N. M
- end;5 t7 b( ^ h8 s$ K
- end;
5 s" T( _* G% \. h. u$ y9 _
复制代码 |