- is
' G% e( V% Q4 @# ? - r:real; file:string;6 B5 _ m( W! R/ z. E0 d! n4 b
- do
( |* ~9 m, D8 f3 Q" D3 B4 K1 \! U - openConsole;7 ]! F1 E8 s3 u7 T: Q, {0 X
- % k$ s- z( p i0 |
- /*' O6 q; B5 r2 Z3 L
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",7 _# F3 h1 _3 \( U/ L [. a
- when is64BitApplication then 64 else 32,
R+ a* B3 G0 K - "bit.dll");
* A% {$ d) r% q! }" M - */) Z, A/ l( d& V" J3 E7 |
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";. n% O5 T% f& Y9 Q2 {& {
- local j := loadLibrary(file);3 M4 D7 o! o! {$ O
- ' y+ U$ B; F s6 J+ y8 `9 H* _/ @% k
- if j > 0 then
" d) ~7 W) W- T) ~2 y6 L7 K6 M - print getLoadedLibrary(j)," is loaded.";3 s2 ]4 ?; y1 e E& Z9 z! ^% C! i
# i& u0 V5 Y6 L3 r( \- r := callLibrary(j, "calcSin", PI/6);
& a0 W& \& S( ] - promptmessage(to_str("sin(PI/6) = ", r));* s! D( R2 S6 P1 i! @( W) ?
-
9 U! _# A9 w, n. z7 f. I9 n - local str:string;, G9 I/ [! ^; Q
- str := "I'm OK!";1 Z4 K( h8 D6 c& S3 n# e
- str := callLibrary(j,"resetStr",str);
+ }8 [- o/ L# T7 A - promptmessage(str);- M3 g% s6 ~2 X
-
+ {0 Q8 U; V g) r2 k+ o" _ - callLibrary(j, "listAccess", Tablefile);
/ b8 k" `: Q8 X& L - % J. D5 X; [. ?* V! Z6 y+ t
- print "Unloading: ", freeLibrary(j);
, B! [% J* V/ z Y - end;: g& h! q0 b: Y' |6 n
- end;) `: }% {0 Z4 ?6 ]: s
复制代码 |