- is$ l! w) S' T! w7 G- B
- r:real; file:string;* F, p# z4 Q; J9 |2 O; `3 p
- do
& s- I* ]: s& E2 d& K3 b7 }. }: E - openConsole;
/ M* r( v+ x4 o1 |, g7 Z
3 B8 y9 w6 e7 U1 x$ ]- /*0 r# u& Q2 d7 k$ N2 d {
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
. n: B* `; E! l; ^3 ~. z( X9 d" m7 D - when is64BitApplication then 64 else 32,
* a; Q8 w5 y. l - "bit.dll");
S0 i) g& g3 O8 D( W# C - */
1 I$ q0 k2 X( ^) C' [ - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";9 M3 [% j; x+ {5 P1 M" y% H
- local j := loadLibrary(file);" O# ~! q/ K7 v+ Z! z- S0 g5 {' T+ M
- % F2 l2 G4 l; T: q2 M! `! q; j
- if j > 0 then6 T. x0 \7 p/ S4 p" N3 X
- print getLoadedLibrary(j)," is loaded.";
4 \1 B9 K- S6 I! |8 X' C- k
7 x) v% o% M2 s, T0 a( {6 @2 N* m- r := callLibrary(j, "calcSin", PI/6);. T6 l2 \, Y- ?6 E7 t
- promptmessage(to_str("sin(PI/6) = ", r));
' N# U! z. c Y' Z. h - , ?3 n7 s6 y) S4 P. \, j9 O
- local str:string;, c7 x: D s; O( T+ A7 X: F/ A
- str := "I'm OK!";/ u6 q5 n/ K) q! a
- str := callLibrary(j,"resetStr",str);
5 P' q' X+ n" i* N7 u( l7 z: L Z& U - promptmessage(str);" g% u. C4 n! S# b/ S
-
2 H; h. x$ P3 q% S - callLibrary(j, "listAccess", Tablefile);- a( A: g4 { H2 _4 E8 Z8 o
- 7 D, K6 N) U5 R3 d/ x
- print "Unloading: ", freeLibrary(j);
- ` G& v/ H7 Z( c: b - end;
. _: s5 x, K) y" Q( q/ Z; t" `1 R - end;5 Y4 b5 O0 q3 S f3 O( z, w
复制代码 |