- is2 `: D3 m, v, h7 |* U6 d& D
- r:real; file:string;: f* C( b0 k3 q& X
- do
. H: l P) |: ? b2 ~% H - openConsole;
7 Z, t# i2 f1 _' H5 i1 t4 r' D - , h4 T2 H( q e2 N2 m
- /*
$ q# n; d- U* f( m: t - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
( u/ G3 T$ s4 Q Q" X - when is64BitApplication then 64 else 32,
: @* H5 m/ O4 a5 }- p - "bit.dll");- x* F L* k: f7 @! @% p% n3 t
- */0 l) Z7 I- C3 [9 p
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
. Z5 @0 N0 D1 H; Q" L0 E - local j := loadLibrary(file);! U1 g: y2 Z: C1 F P
6 N0 }, [; H' A& a' t- if j > 0 then
* ]8 N$ l6 J8 h# L; i) Z& i7 b. Z - print getLoadedLibrary(j)," is loaded.";
& M7 b0 k6 ]* m$ Q - . j$ P; F- d# S( P4 O
- r := callLibrary(j, "calcSin", PI/6);0 Q$ Z$ ^/ h( P
- promptmessage(to_str("sin(PI/6) = ", r));, P; I0 j4 P9 F; E2 m
-
: A, N% c5 ^; S2 k. p - local str:string;
1 H- u, \" K( n5 Q( A4 J/ ?0 I - str := "I'm OK!";' M3 U2 L9 k; n3 b/ e) u3 a1 \& d7 v
- str := callLibrary(j,"resetStr",str);6 _; ]' ~$ s, K" k. s( s
- promptmessage(str);
' c* ~9 l A- v' ? -
- n4 r7 J1 b& J& I% a2 A6 H: S% y - callLibrary(j, "listAccess", Tablefile);/ l1 D, ^5 O h. Z
-
, T5 o/ W/ T8 @ - print "Unloading: ", freeLibrary(j);
. {- v. K P8 x3 q0 ~0 ` - end;
" R; m5 a" P1 j9 r9 F - end;
8 h g& W) ]5 n4 s
复制代码 |