- is+ N, I1 { [7 F/ x
- r:real; file:string;0 p* y! O, G: X2 d. D
- do* k# i) [9 j7 t
- openConsole;* ]/ s% t0 ^' _7 ~
3 D8 S$ j1 C' b$ Z1 v- /*
6 p8 y' t2 Z: Q4 P [- n - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",, T4 c# }3 A' t6 p, t0 W
- when is64BitApplication then 64 else 32,1 Z) K j. |) U* Z- D
- "bit.dll");" C" t0 b' q4 k" e8 S
- */
8 W* A2 E$ K4 o, }) U - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";& }! V( W6 g3 W" R/ {
- local j := loadLibrary(file); E5 U) E) ]; ~* m* u/ T& F, J! ?
: r4 L, n7 F% w8 W& W- if j > 0 then
+ k6 D: N0 f% Q/ T - print getLoadedLibrary(j)," is loaded.";+ _0 w4 N- R# v/ t4 S- N
- 9 [: c: z! N0 I6 R5 \
- r := callLibrary(j, "calcSin", PI/6);+ O- l. l5 v% C. |* _3 q
- promptmessage(to_str("sin(PI/6) = ", r));# r+ ~+ [* D$ X+ R* a
-
( I+ D+ F# W/ o% h, ~. l0 ~' l - local str:string;7 M/ v r3 C- z
- str := "I'm OK!";! D0 B% A2 v- [7 x
- str := callLibrary(j,"resetStr",str);
' p7 F! H |+ A8 o/ u+ C1 | - promptmessage(str);
* u, J0 |; P; M - 4 g+ x; X. }$ L
- callLibrary(j, "listAccess", Tablefile);
% U/ l6 M; c. j# l$ f: M+ [8 l -
7 X: d3 j. ~2 |1 }- ~, p - print "Unloading: ", freeLibrary(j);
; C* }- q( J$ A. _9 l9 s - end;- o* k4 }, X& k. e( V9 g
- end;& J" w. i3 p' J& P9 G, @" g9 J: J
复制代码 |