- is
. q/ S/ u. `, c9 B2 g2 I7 F - r:real; file:string;
9 W0 d9 b8 ]. ~6 i - do
$ M4 W( c8 R% |4 S! \) \ - openConsole;
; S" U1 |4 G6 b g - " l+ l- b. A, d9 _- f& Y1 l% Q
- /*+ v, O; c# y5 `( ?% d
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",# g/ ?! n" O) J( ]8 O4 f! F
- when is64BitApplication then 64 else 32,% a1 `/ G- a: Y) Q
- "bit.dll");
6 p5 g0 e+ N3 u* B7 `& B - */) _! k" k) y" f7 E2 u% @
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";9 `5 @8 H9 z# j6 G4 T
- local j := loadLibrary(file);
% V4 f# Z: j: w, T+ Y
9 {2 e4 l' D k" h4 |5 {- if j > 0 then
: q6 u7 o4 B x3 K* I# ?- g - print getLoadedLibrary(j)," is loaded.";
: a! j' ~) \, J8 S& _# A; H& a - % u8 }% ?% {+ O7 y. { h$ K/ s
- r := callLibrary(j, "calcSin", PI/6); x& x0 Z! |4 F. a
- promptmessage(to_str("sin(PI/6) = ", r));9 f4 U0 R2 p3 O
- + u( j2 [* U) p' f, C7 O% m
- local str:string;+ q# x5 `6 e. F1 c- U. _
- str := "I'm OK!";
* k' h! ^. z& S - str := callLibrary(j,"resetStr",str);$ O! W$ H5 {% r5 `/ p4 v. N
- promptmessage(str);* d& L# s9 ~% m0 f$ y0 d9 }
-
" V1 v5 K3 G: V$ ` ?' Z6 ^ - callLibrary(j, "listAccess", Tablefile);
" D# M; V0 O7 x: N; I% f8 ]( D -
9 X# C C! ]' B - print "Unloading: ", freeLibrary(j);
" B# N2 _3 O/ }( p - end;
9 ]& G6 t6 ~+ |$ v - end;
' x' ^) ~" }# v% `7 P, }
复制代码 |