- is
7 P: u [ O2 l+ a' q - r:real; file:string;
) v7 S* @2 J' Z- e - do
$ k; [2 G7 R$ |" P7 i% B - openConsole;
/ T3 X( G b1 F
8 {! [( W' K1 T8 H/ o- /*
7 N& P v/ }" `, H" d; M8 ] - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
, y ?- _2 R0 N7 a - when is64BitApplication then 64 else 32,) i" W: q7 g0 [" t
- "bit.dll");+ |4 E, c3 i+ ^% ?1 |5 X$ [
- */5 T4 t1 l3 i m1 W( C
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
$ q" A2 M0 L7 t1 R* k7 u* @) T - local j := loadLibrary(file);! X5 {# M4 ^, f0 V3 ]9 B. Y
- \1 P% f, m$ C5 E w- if j > 0 then2 b5 @, [, _9 u0 `3 v
- print getLoadedLibrary(j)," is loaded.";
. Y8 x5 k D& r. R5 @ T - - W" ^. @+ r8 l; h7 ~
- r := callLibrary(j, "calcSin", PI/6);8 i2 t0 l; Z% j; t8 a8 q# P
- promptmessage(to_str("sin(PI/6) = ", r));* Z% @: ?6 ~# x' Z) R2 g8 {+ K
- 6 l* w! d- p, M2 z) X: M6 D! K
- local str:string;
) K5 I6 I4 w7 |7 l - str := "I'm OK!"; z* t8 B1 Y9 a+ g5 U( V; o. H- ^
- str := callLibrary(j,"resetStr",str); ?7 F0 c! u& `( I
- promptmessage(str);! |# t* s. @" a4 |8 T% S$ N9 u
- ! B3 }! J' T C. R6 n
- callLibrary(j, "listAccess", Tablefile);
0 o( Y U0 K7 ^! T - # p, E' E+ H9 H+ W# b4 [4 E
- print "Unloading: ", freeLibrary(j);. u2 I% g& ~( Q
- end;
, f# [. R A. `1 y2 J - end;4 u1 i" x; m. r0 N3 Z" D. e
复制代码 |