- is
B+ b! A$ s' o. P4 x1 v) H1 i - r:real; file:string;
& z a& D* q* b. n. j) Q; J& q; ?% E7 l - do
1 s1 Q8 {1 z/ F) ^& T - openConsole;
& S( W1 ? ^. Q
/ H `$ Y4 @ L, ~- /*
6 H& U; f3 q7 g' _* z6 S) f2 E - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
" n; l9 b/ b1 S9 X4 n0 ` - when is64BitApplication then 64 else 32,3 q7 g" b3 T' B0 D
- "bit.dll");
$ {$ w' ]$ w( d! l* f' J - */
$ g6 t) O d, g6 J0 N& B - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
4 X& ~( ^5 S& Q# P$ K! T) c - local j := loadLibrary(file);6 N" I9 ?9 H1 r0 J" f3 e
* `' z$ D D4 v# R& a- if j > 0 then
7 Q0 k1 Q- |9 L - print getLoadedLibrary(j)," is loaded.";
1 W9 f/ @2 z: h - ) R! _, P* p" F ~+ Q- H: o
- r := callLibrary(j, "calcSin", PI/6);
% Y z% {7 A* E9 p( A - promptmessage(to_str("sin(PI/6) = ", r));4 ?1 G; h# z8 s4 { [; |6 A
- p7 W9 T) [3 B) v
- local str:string;
1 M/ D& n/ a. S( |$ I - str := "I'm OK!";0 X" S# ~. c) A
- str := callLibrary(j,"resetStr",str);
* H- Q, |, L @. v; P, G - promptmessage(str);
# j+ G% @/ S7 ? @) o - ) Z0 h# b: X- C, _
- callLibrary(j, "listAccess", Tablefile);# n; p5 ]/ P# v9 v3 E1 E- w
-
) a" u( |) ?# t5 Y - print "Unloading: ", freeLibrary(j);
8 m7 W3 B8 C2 i% J7 R- Y - end;$ R% a; N. ]1 D6 F {) R
- end;: R8 t0 P' k& T% W
复制代码 |