- is
, y# d- ^: w. c$ u6 v4 ^* | - r:real; file:string;
. R+ ]: }( ^ e D - do
0 k6 v5 M- h8 S' c6 l- a% u - openConsole;) O5 N' G! F& }1 E
- " R4 z7 G2 ]0 G
- /*
# _0 O& i" H+ `5 f. l, d - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf", `4 K# k x i8 W, _
- when is64BitApplication then 64 else 32,
+ K6 M. b1 }, N, p$ y) b% ] - "bit.dll");8 ?! w) E6 ?2 T8 | V1 T3 f# @8 G
- */9 N' q& j/ p8 Y0 I% K
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
, Z9 b3 S, T& P7 O! h+ { - local j := loadLibrary(file);1 n* d0 S7 _3 }. x
- 3 w* v0 X' K# I. r9 L' m7 D# E
- if j > 0 then/ j- B! J' M- Z: i; t
- print getLoadedLibrary(j)," is loaded.";
3 i0 M- |" \$ @0 j3 y& G - ( _/ J, S9 l: V3 V: I5 p! v
- r := callLibrary(j, "calcSin", PI/6);- M* P" Y1 E' X3 U
- promptmessage(to_str("sin(PI/6) = ", r));
. `; m! n; V9 o2 J7 \. } - " H o0 i' B: \9 N7 w& @( Y' M) `5 y# v
- local str:string;
4 O: j/ c3 n! _ - str := "I'm OK!";
% ?: Z) J5 F! J2 W! s+ x1 c - str := callLibrary(j,"resetStr",str);6 f, Y Z' X& h+ X
- promptmessage(str);8 t1 q/ N% x8 s) ?/ U8 o; N
-
4 p/ S! m( S- {/ ]/ O! S% d; Y4 Q - callLibrary(j, "listAccess", Tablefile);
! p& [5 z3 v' a. e5 b -
* W& _1 }( x5 [" v W - print "Unloading: ", freeLibrary(j);1 y5 x9 X$ I0 L6 Q/ @7 b
- end;8 F$ c8 o, O" [+ v1 K4 n
- end;
! q) m0 r y+ B7 k- f
复制代码 |