- is
/ N" a6 D1 ^! R$ T - r:real; file:string;. p, [9 ]+ {7 I
- do
, b+ c5 q: e0 G: \" m - openConsole;
7 Q! U' H1 s' S. }# g) S - % H) b7 |" @% q+ V M6 R0 u) z7 s0 X \/ ?
- /*8 Q7 p" e9 ?. V6 ~' P
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
! H, w* y0 H( _* @5 [4 V - when is64BitApplication then 64 else 32,5 V+ o( k" V; I: S6 e
- "bit.dll");- \. u7 k" z% d, T: U) `, [" e- e. A
- */
0 y5 B) A+ m) _& Q& n! m: p: r - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
4 q( Y! B2 \/ N% E" d) T6 a - local j := loadLibrary(file);9 g1 y0 h1 ~% O* m2 c; G; Z2 P
. X" d/ V- }/ S' T" g9 ?- if j > 0 then
7 F; c6 j r1 Y1 _" J8 Z. w% L - print getLoadedLibrary(j)," is loaded.";
! g+ j) `0 N1 k4 Q7 D
: ]. x; K) S, | M5 {- r := callLibrary(j, "calcSin", PI/6);
; R! D7 D# P/ Y* x7 ? - promptmessage(to_str("sin(PI/6) = ", r));
; r) [; I7 V( F3 j% c d! w - / _2 k" D5 H8 L. M
- local str:string;3 e, W# d2 T- T' l; v6 J
- str := "I'm OK!";2 n x+ e5 X5 N" [# M- y4 W$ R, E
- str := callLibrary(j,"resetStr",str);* s. c C7 J& P: t
- promptmessage(str);
/ M! R+ X3 t+ N" Y) [% N -
- z! [8 o, C0 V - callLibrary(j, "listAccess", Tablefile);0 d3 L/ `, K7 q6 |8 {
-
8 \. A; H' b$ y9 n- g. r& x, ` - print "Unloading: ", freeLibrary(j);
5 i3 ~0 g) i- a6 t( ~! L1 G - end;
& K& t+ D! K& W' n* K q - end;- b4 p+ L" `- w
复制代码 |