- is) f7 E/ \$ [6 ~
- r:real; file:string;
4 l- D% M/ k3 _9 ] - do) G: ^ H" R) m# {
- openConsole;
5 k" B; d3 {# U2 h) v - S$ z; j3 A& h9 U9 K- g9 P7 L
- /*0 `. w. F8 @ b4 i
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
* D$ Z2 k* V5 J4 R1 x - when is64BitApplication then 64 else 32,
; l, h' F% [; p8 K/ n/ ~" _$ y - "bit.dll");* ]' }0 v3 m9 J- ^3 _, {3 U+ X
- */
& ?8 P0 H" Y3 i: f5 G - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";* V( R _; n5 w" C: L" P
- local j := loadLibrary(file);2 ~1 b4 ]( _ A& x
- ) k6 t- j6 ?' k3 j3 X8 V( X; _
- if j > 0 then
& R2 r* w: f# f4 I - print getLoadedLibrary(j)," is loaded.";) r0 H3 Z1 f- t3 o4 O
- 2 \ C' K/ m7 d) f! d0 o
- r := callLibrary(j, "calcSin", PI/6);
! f0 J7 z3 l- r. Y, u' q( T - promptmessage(to_str("sin(PI/6) = ", r));- {3 G, L: V, C
- 4 p1 x, n. V) _' R# {
- local str:string;! U8 T, T+ {; r W$ d+ B/ {
- str := "I'm OK!";: D7 d+ `8 ~8 j8 f' W6 V1 l
- str := callLibrary(j,"resetStr",str);( R y- S0 E- U, Z
- promptmessage(str);
0 N9 ]6 V3 b+ n$ P3 ^" { -
. S+ ~4 x3 E# r; P+ @: W - callLibrary(j, "listAccess", Tablefile); U+ O' ^6 d' p( p
- 0 T+ P4 m& M# L% q
- print "Unloading: ", freeLibrary(j);
' A% S6 W. ~" K! R8 x0 C9 S9 @ - end;' b* W$ Z- P. S' e* L+ A
- end;* v8 I. x- V/ B; `" w
复制代码 |