- is
, J2 w# @' _ u9 d2 Y0 W3 p K - r:real; file:string;
( W* Y: N3 S/ k4 \# f3 w7 y9 ?' p - do' ~7 K" I1 L8 g0 I0 W0 t0 T
- openConsole;$ V7 N0 I2 [, z M3 O, D. o
# K- C3 _% V* K; q, V7 F- /*) m% e& W5 _5 b) y+ i- h) _
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
9 A0 ]7 N% U0 w0 Q - when is64BitApplication then 64 else 32,
4 H4 K' j, N' x5 \+ h - "bit.dll");
1 Q8 S5 R) C; @ b8 R - */
7 t p R" X( I( F5 ?, h" { - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";; I% O0 S+ w1 X
- local j := loadLibrary(file);* L; z W; j& W/ G( t
- " F! R* o% }- w7 v
- if j > 0 then' g" V+ q- Y% l0 o" D3 d( C; U& v
- print getLoadedLibrary(j)," is loaded.";3 w. q6 m: C& g
. C" t- _# r$ `& s5 W5 }- r := callLibrary(j, "calcSin", PI/6);
( e. m9 o D8 E - promptmessage(to_str("sin(PI/6) = ", r));
3 j( }, w5 e, w) A# b& i, Z3 A2 `; U - ' }' g& v( m1 B& A3 A8 Y v
- local str:string;) C" k# l: ~6 Q1 c' T
- str := "I'm OK!";
. l' n' d$ x1 [7 I4 A9 P - str := callLibrary(j,"resetStr",str);. V$ n3 f0 i0 F! z; K9 i
- promptmessage(str);
0 f: K% S' j! [; j -
x+ B/ W$ r6 \4 D+ q& d1 h - callLibrary(j, "listAccess", Tablefile);
" H! j s8 Z! X8 ?4 w" ?8 b -
* [9 V# w+ L+ o$ N4 ?1 l& V& I - print "Unloading: ", freeLibrary(j);( U) o) w% \) L ?% G+ q2 _
- end;
" L% e) |2 k/ S: q9 ]; Z9 N% o* K - end;! B3 w4 f6 |& E3 `
复制代码 |