- is
$ `2 F+ H/ x: @: @1 `+ f- I$ i1 [& ] - r:real; file:string;! q1 y- y% i" z9 T/ x0 h
- do
* ^! a0 u( ?& S" w9 W - openConsole;
- j; |7 s3 N. V* _ - ! i7 W: [7 b& T- g2 q7 I
- /*4 k1 ]9 }8 A8 W' e! F; _) l# t
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
1 j2 O* |1 @! a. T. y - when is64BitApplication then 64 else 32,
. J7 S- h( l8 V& v5 M% z G- U - "bit.dll");
7 x0 R. T! M+ d5 ^# T' X5 H' V - */
7 R% o; E5 _, D8 L# A% n1 i. k - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
- [# g; I8 @4 J! Q: R9 N - local j := loadLibrary(file);+ ^$ {1 t; u9 X1 S) v5 ^* l
2 O1 b! Q5 G- L1 {8 @7 F- if j > 0 then
( x. u: h& \* @. L- m6 w4 r - print getLoadedLibrary(j)," is loaded.";
$ r- p8 X1 ?7 E - 1 k; _6 a) w: r1 P- e0 V
- r := callLibrary(j, "calcSin", PI/6);* i: I3 z! `6 X! _/ L; f
- promptmessage(to_str("sin(PI/6) = ", r));
6 V1 h% [0 ^! P: K* E3 R - 2 Q$ H- Y% d! I6 Q
- local str:string;' ^+ b6 o0 t9 ]5 e" p
- str := "I'm OK!";3 ]5 m2 o" S" W ?. W) e/ Q: ~$ {
- str := callLibrary(j,"resetStr",str); S$ M0 M; `2 Z v1 _$ O6 k
- promptmessage(str);
! y* B! v7 J* X: W% c# M- e - ) V1 O$ \3 s% g: \0 K1 {. S0 H
- callLibrary(j, "listAccess", Tablefile);% u3 G; _' @0 J) y
-
$ n h' S9 I! ^7 a j# D; U9 t* u - print "Unloading: ", freeLibrary(j);
' D8 G$ r; F+ s" _ - end;
* A* K, G- ]2 j9 t5 y- E, a$ ~" V$ X4 l - end;) a% g0 ^% O9 n, l4 G, N+ o* |
复制代码 |