- is
c4 l/ w. I. C5 n - r:real; file:string;
! f# B) Z1 f! J A$ x - do7 }% w' m7 w/ `0 I9 d
- openConsole;
: x! Z" [; {: a1 w9 Z) y
4 F! e6 d" Y3 D% m& y0 B- /*7 l3 ]# z. X$ p! x
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
6 g8 _% J+ P- G8 v8 J4 U' ? - when is64BitApplication then 64 else 32,' T/ E2 }4 B* z6 {. C$ F8 Q/ y
- "bit.dll");
6 G8 z3 z2 w" o: k - */
5 N; g7 w4 q7 E - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";9 V0 N+ h$ F& I, b/ }9 F9 t1 T1 S
- local j := loadLibrary(file);
q, N% f& u5 k, {6 i9 O3 i7 _
- d9 ?8 X5 a O4 s- if j > 0 then
0 B+ z. i8 n: N* T- ]( P - print getLoadedLibrary(j)," is loaded.";( \$ L5 k. ?2 i1 W; c; L8 w
- & T" A: d; d8 I; U* D6 Z
- r := callLibrary(j, "calcSin", PI/6);
4 ^- Y. i! }, G' X4 y) n9 X - promptmessage(to_str("sin(PI/6) = ", r));; m0 h* C% v. _& m( |. Z
- * z3 f7 a) Z* P1 U" S2 E, g
- local str:string;
( x' B; P: H2 j' {0 z1 p d - str := "I'm OK!";
) y# x5 y2 w9 U4 O. J' U4 J2 o9 E9 K - str := callLibrary(j,"resetStr",str);
- ~1 y" ]6 n# p1 G8 X - promptmessage(str); } \, } m4 L" Y j! f
- ( |2 u, B3 E0 Z" Y/ L
- callLibrary(j, "listAccess", Tablefile);( p4 g" S/ x: \9 l1 u( |+ f
- + @& M6 G+ p* `, |/ S. H% j* N
- print "Unloading: ", freeLibrary(j);# i! e. @( V9 k% H; W
- end;
. r4 m8 R% I$ s q) B" w0 L. a - end; y, o1 A# p5 n" O0 v/ t
复制代码 |