- is& q' U) m% e: t5 {8 g
- r:real; file:string;7 I! K3 ?- k, U. J) k& Q
- do1 ]$ b; z" Y2 `$ z$ v0 E, ?
- openConsole;
+ d0 a& L: D3 ~% O' ~8 ^: H
5 n- L8 ~ [/ y- /*
4 R+ M- k2 x& t9 ?, r - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",7 G. Z$ n) {7 l: u2 J' \6 j
- when is64BitApplication then 64 else 32,! Z9 r! T" c4 o( ^& Q
- "bit.dll");
) w4 N$ k& o& W0 X) }* ? - */
T! w. z4 F5 l5 y9 _1 O+ z# W - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
( G. G7 ]& t1 W# k - local j := loadLibrary(file);
1 G- H! {' f0 i. c - : y7 k) m c3 U) [% u* g
- if j > 0 then" z" f/ b" ?" Z
- print getLoadedLibrary(j)," is loaded.";3 M6 }; R/ p2 M
" l" g# ]9 M. V: H2 [- r := callLibrary(j, "calcSin", PI/6);
6 E( B( u3 M8 B: h - promptmessage(to_str("sin(PI/6) = ", r));
5 W5 A5 z& x6 k8 l -
3 ^4 p& N6 h: h4 J5 `3 G0 X1 d5 ~- V- x - local str:string;
5 R- e9 S( ^( A9 Y6 l4 V% R - str := "I'm OK!";4 H5 B7 }. W; U
- str := callLibrary(j,"resetStr",str);9 J2 P z" G- ]8 V' }- q6 `
- promptmessage(str);
' F2 l% W0 d/ Z' b; K8 b- h& H - - j$ i& N1 H P" B+ |, `
- callLibrary(j, "listAccess", Tablefile);& O8 t) ]) U; N; F" ]3 ^
-
, V3 [# `! o9 G$ ?% v - print "Unloading: ", freeLibrary(j);1 O1 @- {2 g7 A3 ~* p! B8 g9 p6 o
- end;' I T5 y% f' u0 c
- end;; p0 ?! N5 U* L: V
复制代码 |