- is
\$ P/ v+ V, O: j. y7 L - r:real; file:string;; L" a) d8 O/ m' v! J0 f
- do- b. E3 O; F* }& e: R9 ?5 V
- openConsole;0 ^# W$ \7 `4 g- l! T+ x0 I
7 Q3 w* Y7 w9 ^& Z! L- /*
2 ]3 \5 n/ ? V6 c- ` - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",7 h5 S) D0 j) Q' l- X1 y" _ F
- when is64BitApplication then 64 else 32,
; l% n$ ?% e3 k - "bit.dll");" d) d" q. s4 k: X& s+ F2 X
- */
7 G; T- ]( Y6 x" \ - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
: k# r, ?+ Z: g7 _( O - local j := loadLibrary(file); F" w2 _5 C5 U& V+ u' v. ]
w- R/ U: g& L( ^- if j > 0 then
s' ^# R7 z( K: o, R2 ?4 z - print getLoadedLibrary(j)," is loaded.";0 h1 R Z9 m- E
- 1 ` y/ F. r) p$ x0 ?# M# G D
- r := callLibrary(j, "calcSin", PI/6);
% ~" L* R1 N' O3 [( e# \. L" s - promptmessage(to_str("sin(PI/6) = ", r));0 m3 c; X& G& \: B+ d
-
; n# E0 Q! M6 G - local str:string;
, ^6 x0 E* p/ Y; o: t3 S - str := "I'm OK!";# k& B# f1 b8 w6 X, S
- str := callLibrary(j,"resetStr",str);
. I" @: V' P0 c/ w - promptmessage(str);4 h, A" F h. s M0 ?8 N+ [
- ' y" u! g: G% R
- callLibrary(j, "listAccess", Tablefile);
- q# V+ K9 a5 u$ Q" X5 w -
# h8 c3 ]; P: ?& V$ } - print "Unloading: ", freeLibrary(j);
3 X) a" E, u; p& c; j0 g- ^ - end;: w& o4 k+ t$ M0 P; B1 @4 @
- end;
; d3 [" ?% z1 S) _8 q( \7 x6 r2 c V
复制代码 |