- is
6 b% _$ t' i l5 k - r:real; file:string;! N0 Z4 O$ {& F/ t6 P. [
- do
: c: Q3 t9 x: N5 f - openConsole;% u: J5 W2 C) F& y( u0 G8 t" |6 n
9 F; P- b; s- K8 D+ k- /*( q) L- A l: e, a
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
6 g/ {1 d, K; k0 `1 i* O - when is64BitApplication then 64 else 32,
6 P3 T! m5 Y2 K# g. ` - "bit.dll");' D% N. l" r5 Q" A) r7 s
- */
( d; o* s4 P5 r# ^ - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";& ] m. A) }* B" o9 g! ~5 G$ m" O% ^
- local j := loadLibrary(file);0 Y2 R9 z& Q6 }) q& S4 j3 u" h9 r
+ n9 h* O8 m1 i" e% a% d- if j > 0 then
( I5 y2 a) Q# K' n8 [7 d# _ - print getLoadedLibrary(j)," is loaded.";! ]* B5 E4 u! ~ s6 D
- , l. j' J: F3 B/ @% L
- r := callLibrary(j, "calcSin", PI/6);, q- [! F6 M' w* B+ `
- promptmessage(to_str("sin(PI/6) = ", r));
$ k! L( {: h" R! R. U0 f" O -
) ^5 b) [, o' i5 w1 F - local str:string;3 ^! \" O- E- { l7 d2 ]
- str := "I'm OK!";
1 b+ N' A9 m& Z - str := callLibrary(j,"resetStr",str);
7 x; d5 ^" s' E6 _/ K- k. t, Y+ o1 O - promptmessage(str);. a, b- z# z) {7 I- g, O
-
6 U' U& \- a# r2 s% [5 U - callLibrary(j, "listAccess", Tablefile);+ n; R5 ~7 Q8 t' ]8 U3 ~; u% s% G% y
-
0 ^ q2 n* W+ o4 F5 V - print "Unloading: ", freeLibrary(j);
. |0 c8 |+ n* u - end;: _3 S, Y: R; l7 s9 e( `: n
- end;: {/ ]* P, _2 y |' S
复制代码 |