- is! {! y7 G0 f# i0 ^
- r:real; file:string;
2 K9 w" w, I4 `$ y/ R ` B7 b - do" ?6 |9 }% [: c
- openConsole;
* `. Q: N) s) I, R! H7 X# l
' Q5 N2 @! [/ P) d, s/ e& D- /*& d; i& x1 b0 J8 h: a3 R0 u2 X
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
: n0 n+ ?) t; i0 V - when is64BitApplication then 64 else 32,
0 w6 L1 N( {& F3 ?0 |7 Q - "bit.dll");
, o c/ a, B9 a - */
3 Z1 ?8 u* _/ b" \ - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";( \3 S8 l$ }2 ]; @. J8 d( w$ ^( m
- local j := loadLibrary(file);
+ L5 x. s% O6 [
5 z. I! y2 y' Y3 o4 e- f+ z- if j > 0 then5 }; Q- I% h7 X( _
- print getLoadedLibrary(j)," is loaded.";2 L/ O. s7 [1 K3 X
- 6 I6 r/ G: J( d! k5 F9 y3 F- ?
- r := callLibrary(j, "calcSin", PI/6); E' K* O8 g. u9 r7 \& ]+ _( x) |9 W
- promptmessage(to_str("sin(PI/6) = ", r));
1 y2 I5 b$ z# V) I: f1 g; s/ m - / e [9 B+ I; F
- local str:string;1 H9 a7 u2 C) i, B7 y
- str := "I'm OK!";
" L$ ?. z9 a/ H8 p$ X9 J" p) ` - str := callLibrary(j,"resetStr",str);5 [( I- {) Y* _% M/ H
- promptmessage(str);/ x. E7 r. w+ _6 P) ]& j
-
8 K! |& e4 j8 Y+ f& K - callLibrary(j, "listAccess", Tablefile);! y& T% U: S. h
- 4 J, F6 `5 W- X, q! C6 H1 b
- print "Unloading: ", freeLibrary(j);3 L! v, d5 g7 Z5 d$ f
- end;% X) @( o$ J0 ]
- end; i1 F& A) L6 a: e1 w2 p& b+ E* S
复制代码 |