- is
6 k3 z9 |# i' j - r:real; file:string;6 i; ] e5 E! W' P+ f9 Q; g6 Z- z
- do5 s* Z8 `2 l1 h7 W1 b' C
- openConsole;
) |+ M4 W6 @4 F, J
7 ? s; x" g$ }' T- /*
4 S7 Y5 E" ~' y - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
5 R7 x, |( e$ s! v. O/ N! D - when is64BitApplication then 64 else 32,. E, R! n' e3 L( ?8 f m
- "bit.dll");
% ^, @. C8 Y' d - */
$ q N' [6 y3 H% Q, b - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
. A0 ~7 T0 Y2 ~; l6 h" B - local j := loadLibrary(file);5 E1 N4 J1 U2 a3 a, [7 Z: ^
) F# Q) o" Q$ i2 m8 U! M m- if j > 0 then6 M& o4 o) p, S7 T
- print getLoadedLibrary(j)," is loaded.";
7 p' e1 u& F. u: _9 f1 ]
4 U" U# f1 F Y' A; |! y9 T- r := callLibrary(j, "calcSin", PI/6);3 }3 B& v6 H1 d2 e$ M
- promptmessage(to_str("sin(PI/6) = ", r));; J {" L4 K3 A" M9 e( A
-
; y6 h5 W2 H8 d6 _1 j/ ` - local str:string;
- r- X2 h0 R* M. k4 b- h4 ^ - str := "I'm OK!";# k% Z8 @( [2 r9 y- @, B
- str := callLibrary(j,"resetStr",str);
* s# A" ?- S1 p! K3 t* l2 ^1 Z - promptmessage(str);
4 m- F; S v8 k9 d; y -
+ A. h- T) p7 a0 {$ C0 B$ Y - callLibrary(j, "listAccess", Tablefile);
( w1 a, K) | e - 9 u5 q+ s$ Y# k* B9 w8 m5 f
- print "Unloading: ", freeLibrary(j);5 u K$ F9 v' g- u. Y$ Z7 o
- end;
& \ K. u2 V2 r - end;1 E: t. O1 g% h
复制代码 |