- is
( a9 P- g) I6 B* z4 `7 x2 e/ q - r:real; file:string;
1 T/ b9 d/ T+ S" a2 ?6 G' L' k0 q - do8 S9 C. s# l( v/ l# _9 @" r5 c
- openConsole;
; W% E, u' {* R I' Y
* Q0 X [+ {. Z# H- /*: \: w) L/ Y& ?7 K# R. e: L% Q
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",# s/ ^4 R$ S- `3 r
- when is64BitApplication then 64 else 32,9 t1 q& @; J$ R7 |, R
- "bit.dll");
. c3 A5 z9 ?: _5 t - */4 [: J: _, O9 ]
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";/ \5 u* \4 y- B( ]1 P3 R0 y( B9 j
- local j := loadLibrary(file);+ Q& b) E* y0 D% x3 U: T& @
- ' ?! x( S( [% ~! N, B
- if j > 0 then
0 U$ M1 I# `) X& H7 \9 Q( l" e - print getLoadedLibrary(j)," is loaded.";7 x8 v! l: h3 z+ m9 O4 j) `
3 M+ j! c4 J4 i8 I6 O6 i, A- r := callLibrary(j, "calcSin", PI/6);2 Z, i; f9 d$ ~
- promptmessage(to_str("sin(PI/6) = ", r));1 j4 M& Z: e2 y+ s l/ W8 J
- & ]8 x# Z! K8 p5 C V( p% ]
- local str:string;7 x. N) X3 k; [" N" p
- str := "I'm OK!";# X' D) ]7 d1 g/ M' J7 f
- str := callLibrary(j,"resetStr",str);
k* }3 q6 Y, W - promptmessage(str);* U! g* J0 B. X
- ; g' g$ W D3 v+ e" L+ d8 Q C
- callLibrary(j, "listAccess", Tablefile);
' Z+ F4 y# F) T7 f -
3 x1 c) Y# f2 t6 r$ S% G - print "Unloading: ", freeLibrary(j);
: w, x8 y) d' |" z - end;0 S- ]% S: X' g, O- U+ e# F: z
- end;1 e$ D [- k, }5 A C. h- C7 y
复制代码 |