- is
' b4 A4 M! g" N3 m- |6 w - r:real; file:string;0 U6 C( \) g# h2 i, A8 R/ R
- do: O6 f" o5 Q0 c9 H
- openConsole;
2 n8 _$ R8 r4 f) ^' g
( K. t1 f- @7 v% ]& `- /*' V: V ~4 S/ J
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
: o6 K) S3 d1 M - when is64BitApplication then 64 else 32,5 R1 H+ o0 F1 J1 F4 Z
- "bit.dll");
3 F+ j& x$ F/ g. a6 q8 ?" T- ` - */, z. ~. i" g/ }8 T/ p
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
5 A7 d2 y; e; s2 T8 D$ l4 e - local j := loadLibrary(file);1 e" F5 R% z7 O4 @3 _& P5 Q7 I) b
- 2 s' B, S* _+ s7 {, G$ x: C
- if j > 0 then) {& T, ^ ?2 u, i' ?/ L
- print getLoadedLibrary(j)," is loaded.";
9 g9 R7 |4 a' B! v! d - 4 u/ D. Y# t8 w
- r := callLibrary(j, "calcSin", PI/6);
$ ]+ Q5 P/ u' w - promptmessage(to_str("sin(PI/6) = ", r));* G, }, h7 T1 }& H+ U6 B
-
6 m0 \5 `2 b& O, r7 G' { - local str:string;0 H1 Q3 v3 k3 o, D( `3 V
- str := "I'm OK!";
) x% z1 o0 {4 R8 Y - str := callLibrary(j,"resetStr",str);9 u2 j: O: Q- E4 n, F+ V% N/ c& U
- promptmessage(str);
- b/ c$ M3 t% J$ K1 o0 \& V - 9 d3 g* w0 W9 r6 X& a! C
- callLibrary(j, "listAccess", Tablefile);
: x5 ^. ?- i2 @7 ^+ M - 0 W6 l; y, W+ K8 e( c' _. M2 V
- print "Unloading: ", freeLibrary(j);, h, }: y) F" G! z _" v
- end;
/ @# y2 D- ~) H- o6 Y - end;) O7 {5 X6 N, s0 g
复制代码 |