- is+ f% ]0 N# T& D$ r9 u
- r:real; file:string;
8 }9 I8 `/ h9 ~2 P0 } - do7 K* v/ n" w+ M
- openConsole;$ Z3 c5 _0 @8 |& m$ O9 l [& F2 @: A
- $ [ M5 {8 `3 D$ R2 \7 q
- /*
; Z; \9 S0 O# m2 O6 p: n - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",' b: q5 R$ Z N+ F5 v2 S; {
- when is64BitApplication then 64 else 32,
! x$ ^+ y- B# b7 x - "bit.dll");8 O2 J( _' C+ w, \$ W4 R% u
- */
/ ~4 w6 ^6 L% ^0 C* i7 |5 N( N( V - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";. @+ u; u) D6 i! @: N5 N% q5 C4 ~
- local j := loadLibrary(file);! d) _% V( G& K. @1 y. A1 H
- 8 {; E- {4 }( l7 q. A$ d
- if j > 0 then
" j8 U! \) i2 P1 ~3 f: e) M# y5 t - print getLoadedLibrary(j)," is loaded.";
( `. M/ Y1 C% x( k8 B% u! N
z9 s. f4 |( `; P: s- r := callLibrary(j, "calcSin", PI/6);
% {2 R4 Y; [9 p; ], U; u - promptmessage(to_str("sin(PI/6) = ", r));8 _1 P! N7 ~$ }" v( |
-
6 Y* |& o% y) w% Y: \% H# K - local str:string;
9 t0 D7 W" R$ u# l) F+ H - str := "I'm OK!";( x7 F5 ~ C8 v
- str := callLibrary(j,"resetStr",str);( R3 v7 X2 N b, q
- promptmessage(str);$ f: y8 d: B" B r: R7 ?
- $ j! `/ W4 R$ U0 a
- callLibrary(j, "listAccess", Tablefile);4 x0 V1 Z( n) {% I/ B+ x& n4 a
- . E/ R A% ^6 k0 A* ^0 J4 U5 b
- print "Unloading: ", freeLibrary(j);- M, \$ w( V Y
- end;
+ b+ K P3 J+ i R0 l) V - end;# Z4 }; y2 k' S0 D& c3 ~: B
复制代码 |