- is
+ n* H" F% O, Y0 G7 ?, z - r:real; file:string;
" x4 F; F) j1 u6 c, i3 j" { - do
8 `$ D; \$ k/ r R1 T ^ - openConsole;
, g$ N+ ]8 X4 H- t6 c
6 Z8 n+ F$ d. o- p7 O0 p5 F/ g& S- /*
# s( }0 y! c# g$ n! l% g$ g& I+ L - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
- r% H7 d; J. I; f0 i: @1 L5 X z - when is64BitApplication then 64 else 32,
0 U, O: W( p/ B5 s/ A7 C - "bit.dll");0 O% ^4 b/ e: | n9 |$ @9 T
- */+ y5 P) l3 ]- \
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
% H! n/ f! Z" U2 o - local j := loadLibrary(file);8 T% [: k# Z* l& K& b: F
- " u# n* `. n# T
- if j > 0 then; k- h" K2 l- d/ i% e) T" [; U
- print getLoadedLibrary(j)," is loaded.";
/ C2 y% y% L; M" S7 ] - ! g3 w& T# A* N9 e- ^- w$ a
- r := callLibrary(j, "calcSin", PI/6);" D$ {7 f5 w( R0 [
- promptmessage(to_str("sin(PI/6) = ", r));
+ S" ^6 K* D" M5 O$ D, }; I& ^ -
# @! ^; d$ }1 b& f5 M% a$ p9 {4 D - local str:string;% p* q& i- C6 ~: }# j
- str := "I'm OK!";" l+ {" y0 V+ [
- str := callLibrary(j,"resetStr",str);
! F" r% `7 e, i+ j g - promptmessage(str);
, ?9 c* n" a9 U -
% x9 Y5 {+ z; X! q P' o; ?+ _ - callLibrary(j, "listAccess", Tablefile);
% ^# i% d/ F) f! } - - a% P+ b$ r7 T* u: s" R
- print "Unloading: ", freeLibrary(j);) E# U {6 x; e: t2 o
- end;
2 u V, z2 I$ Q7 g7 d - end;( s( s, `0 b% k7 g
复制代码 |