- is
3 {: N. ?1 l R - r:real; file:string;
; E& _1 `) b) \3 k - do' v' \5 E: S- b8 m+ e+ X( L; h
- openConsole;
; i& V7 E( H$ H, `$ {, g" @7 T - 5 x1 o9 O( T" N6 {1 H7 O
- /*
) N) B% G" Q% J1 W# D' e F* z - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",: g; e! e6 y5 p% ?) H' t
- when is64BitApplication then 64 else 32,; O. h6 |) E! z* B/ y
- "bit.dll");
6 {7 u$ S) u4 N: f - */4 c+ L0 b5 k8 F
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
& q# y/ }7 U V7 `! b - local j := loadLibrary(file);
6 G: ^& D' K4 A f4 N
' u+ I3 x& A( j8 R2 C" }- if j > 0 then
+ z9 s0 O2 I* @7 W% K& ]: \ - print getLoadedLibrary(j)," is loaded.";) T+ g& B$ }. B
- & ~2 ~- }, d2 r9 f% X$ X0 h( N$ M
- r := callLibrary(j, "calcSin", PI/6);
7 E) g- q: ^, u- F6 V' N4 a - promptmessage(to_str("sin(PI/6) = ", r));, i! A6 a" Q& q1 v2 Q! L
-
5 O, P# h" M1 L# e4 `8 X - local str:string;5 e7 R3 u8 ]2 [: i
- str := "I'm OK!";! d3 K9 S6 v( M4 l. {# ?; Z2 s2 |
- str := callLibrary(j,"resetStr",str);
( N' ^0 X. w A/ i% U - promptmessage(str);5 E# s) `7 j+ J" U; R- j
- ! g2 G3 x/ e" X! ?/ V
- callLibrary(j, "listAccess", Tablefile);2 q. U0 S" x8 j, g- O8 Q
- ' w# C1 I, t. H3 c# Q
- print "Unloading: ", freeLibrary(j);
1 D4 P, X5 P. D) S6 A - end;
4 b" D, U- s+ o/ a5 X - end;
: p: N9 ^& u& i9 t, y; X
复制代码 |