- is% X. o3 p$ t& L5 x
- r:real; file:string;
' g8 _0 W0 s/ t. T& t - do6 v! s5 T Q+ `% ], P% q7 _, o |' _
- openConsole;
$ L0 }% m4 {. R1 d3 r3 E7 R$ X
7 z$ L9 b, U9 c+ b8 e) ?$ Z1 y) S- /*
) |) A, _; U# m3 r R3 ]4 L% @ - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
# E7 Z& r# U$ Q% q# N$ o - when is64BitApplication then 64 else 32,
" f5 e: f1 g5 Z4 w8 N" m - "bit.dll");
' ^! W" o& b# H4 q! H& X - */
" m: |% c" `9 D0 [ - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
?5 q6 ]) J& o9 d9 v - local j := loadLibrary(file);
- ~. [$ H( k# `/ w' _' ? - : Z! w1 W3 i/ h: V
- if j > 0 then
5 K! |4 W9 z, s" R3 `- T! F - print getLoadedLibrary(j)," is loaded.";- I4 W# k2 B6 a) \2 [! a$ G+ {
+ i9 X5 T: k4 c, N3 w- r := callLibrary(j, "calcSin", PI/6);
6 l; ~: I8 I( l" r - promptmessage(to_str("sin(PI/6) = ", r));' [8 i, R8 ^$ t
- $ Y; I0 H+ x Y0 ~$ E |
- local str:string;
, g1 I- \& J `0 x P - str := "I'm OK!";
/ E6 z: ~5 d3 Y; n' q9 g% | - str := callLibrary(j,"resetStr",str);
+ z$ v" ~& k$ E) N) [ - promptmessage(str);
$ W8 n; t6 b5 W* u+ ? - ( L7 A. o0 L# a0 `) h7 T; u
- callLibrary(j, "listAccess", Tablefile);
* J' T) R$ X- z2 L -
' C* e' X5 T. ]4 c' y) l8 h6 A - print "Unloading: ", freeLibrary(j);% z& }2 Y! D$ ?6 I! g
- end;2 B* d# V# R9 e5 S9 Z
- end;
! Q3 ~9 P. {# N* r! X% R
复制代码 |