- is" Z) t! D4 `: }# `: |* Z
- r:real; file:string;
% T2 F3 \ D$ D - do
! x3 Y; a J8 s% P( h$ [ - openConsole;
, _! t3 [. ~: Q1 J2 d* n6 T
# {( }* L+ W0 I- /*
5 k. E- _# r O# } - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
, `0 T# k% \ D. j - when is64BitApplication then 64 else 32,
7 [, h- X/ D9 {: E b% ~" t/ p - "bit.dll");; l: m( s) V9 v: h _
- */
2 f7 w& N+ C3 q: o1 e' |3 h - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";. R" P" k1 F+ T. f. s# S
- local j := loadLibrary(file);# d" e0 `& R( ]$ A
+ U" i" i" U @' i4 E- if j > 0 then
3 ?4 F- |; Y( x2 r7 r - print getLoadedLibrary(j)," is loaded.";; B3 A( n1 ~/ M/ T1 T" Q. R
3 h5 j8 A% Y5 o1 L- r := callLibrary(j, "calcSin", PI/6);
( Z4 M" z) `2 o+ S0 p - promptmessage(to_str("sin(PI/6) = ", r));
" q% A+ |/ D2 l' ? -
- S) I. w0 i% [- R6 S% a - local str:string;0 W) A7 J" w6 r- Y+ y9 r
- str := "I'm OK!";
# P' f, P& n9 [& X# W/ z - str := callLibrary(j,"resetStr",str);7 _5 B; Y- b# I v9 v
- promptmessage(str);
2 `4 v3 N/ W$ q5 f -
% U* s* \9 Q* p/ r% J - callLibrary(j, "listAccess", Tablefile);
' a1 z" {/ s+ k - ) K, {+ }' B" u1 t5 @
- print "Unloading: ", freeLibrary(j);% `0 r" k: O9 v4 ~' ^
- end;
; c+ v3 i9 P* V2 E- v - end;
/ S3 @6 u8 ^' V+ X w1 |
复制代码 |