- is
. K, H2 m' C" a( a# f! | - r:real; file:string;
1 ]' Z' T1 p: f/ e2 R* t+ h* k - do+ d+ e, f/ e" ?7 v' r
- openConsole;9 x7 A$ Z0 v' D n$ h
- 4 J& I' l, Q0 S0 h
- /*
' j Z/ _1 b$ s1 [4 ~ - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
4 `+ [6 o7 Q! Y5 ^! V7 @- e - when is64BitApplication then 64 else 32,
t, g' z- R6 J; A8 P - "bit.dll");9 g8 }4 v, h, @9 X3 W# o/ {
- */
7 T! Y' B1 W% i& ~' {& ^8 F' H - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";( ^2 c% r4 D: ~2 k4 `
- local j := loadLibrary(file);
! U8 w/ l* V7 C4 z! S! N
5 t/ T. {: N' C |' ^- if j > 0 then
0 ]0 }, q) ~0 G - print getLoadedLibrary(j)," is loaded.";) U4 h& a4 a6 K5 |0 w$ l
6 D) I6 |# N8 R6 N- r := callLibrary(j, "calcSin", PI/6);
; `* X* K6 w8 K+ S8 d" |2 ` - promptmessage(to_str("sin(PI/6) = ", r));; Q$ V+ @* [# _/ B& Z
- R8 }$ B, x5 [# n+ O) \: R
- local str:string;
4 X* Z6 D1 R/ [7 f/ C& u P+ K - str := "I'm OK!";/ @9 v# X1 d/ k" T# _
- str := callLibrary(j,"resetStr",str);
. ^3 \ {, t( s0 G: u - promptmessage(str);
6 n4 f4 v: H1 p! y- t, Q' S1 S - + }" N' R, f' h+ Q
- callLibrary(j, "listAccess", Tablefile);
% b4 z' Y3 R$ E+ `! ^ -
: ^8 O+ ^# F- T3 o - print "Unloading: ", freeLibrary(j);; I+ f. d4 f" }2 _2 d
- end;
7 }( A' H' a# L8 E% Q) v+ D - end;
. Z. i0 ~4 s3 x. f
复制代码 |