- is! i8 x6 X9 B: _9 s/ F' y
- r:real; file:string;
( H: S) c, c# n - do! [) i# h( [' {+ O% w! _
- openConsole;
0 Y U5 a) V- I1 i - J8 K+ k5 e7 a: c& S
- /*
% n: n+ e% U1 D( b, Z( `% M - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
1 u3 R; R& S8 ]8 r' G - when is64BitApplication then 64 else 32,
4 S+ \8 Z) {* h G5 s - "bit.dll");
4 O. o7 ]. N* S/ S( Z - */
5 t T: T* { Z3 V - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
' C' J7 f' ^6 V5 g - local j := loadLibrary(file);! |- D. W1 @4 M* g0 s/ r, E9 h9 n; x
- & f- [9 {1 K8 q: ?7 Z) M
- if j > 0 then
# h/ Z6 o G+ F. w* A - print getLoadedLibrary(j)," is loaded.";9 ~3 O1 x& Q6 |7 j
* l, w4 V( J9 m- r := callLibrary(j, "calcSin", PI/6);( d6 F& M2 Q6 X4 s3 S. y' m
- promptmessage(to_str("sin(PI/6) = ", r));$ g4 n& ?. o. U" s" }4 t
- % j8 b I o4 r: b3 |
- local str:string;! Y8 V; o3 x7 X
- str := "I'm OK!";
/ p! i4 T/ e0 ~' H0 l8 ~1 Q2 }4 ^ - str := callLibrary(j,"resetStr",str);
* k. L" O% |$ o+ K! u4 | - promptmessage(str);' P# e) m' Q0 E( u
- : c2 I, w9 b8 M; q* H) Z
- callLibrary(j, "listAccess", Tablefile);
* V$ d" ` {9 Y4 s, k6 Z) K -
2 z: I& M, x @, c' k8 L - print "Unloading: ", freeLibrary(j);
) k2 |2 f1 `9 ~ - end;
8 ]9 {; r) K0 |: \2 W - end;
2 |! m/ q2 B7 i- P
复制代码 |