- is
$ H) n0 K3 O/ e$ t9 c - r:real; file:string;: K/ b. N* Z7 ^4 ~
- do) S% v C8 F: k) m& D" y
- openConsole;
. s' |9 M4 ]0 ]( P* ^
5 |2 K. U. @- P! z6 v2 J) f5 j- /*
' l. u' p9 U3 N& J) @. v3 u - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
/ E1 f9 i. I: |7 W5 U; b% ^% c - when is64BitApplication then 64 else 32,
6 T# _$ x7 W. n9 v% S' Z4 ?5 I - "bit.dll");( D5 V! K6 X; y
- */
& K) M( g; }5 B, ? - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";* S0 B6 ]8 P+ _" M
- local j := loadLibrary(file);; Y! m: I% ~2 G2 o1 Q' d$ s
- + O$ M/ T W1 z
- if j > 0 then
F4 ~' E$ O: p4 W$ F* f* ] - print getLoadedLibrary(j)," is loaded.";7 E R Q* v5 {, J( X/ d( \8 @
- 6 E+ h2 o2 c5 i- t+ B6 o2 w
- r := callLibrary(j, "calcSin", PI/6);* R) M6 e4 o+ |
- promptmessage(to_str("sin(PI/6) = ", r));9 v/ w, S7 e% n, s
- # a1 n* o9 ^8 d/ S
- local str:string;
7 ]- i* s! d/ B3 j6 ^ - str := "I'm OK!"; X2 S O; t* G3 P2 D5 W0 E+ A
- str := callLibrary(j,"resetStr",str);
" ~4 K m1 |6 k - promptmessage(str);
& I* J b% ~# l8 e8 S$ j* w7 d -
0 r& j5 z0 F8 j4 u# s3 k - callLibrary(j, "listAccess", Tablefile);* {. ^: r7 N' T) N
-
8 w8 j; b0 a3 ?( Q - print "Unloading: ", freeLibrary(j);
c7 e. w7 \4 S' A" J+ d/ N - end;$ j! X& ]. G) W4 n% I4 g7 T' t
- end;
4 }; ?* m" j: p! u. }: T( C
复制代码 |