- is
, z4 H! B. b+ \' } - r:real; file:string;, A7 E( A; F1 h/ _% w$ D
- do, z. B8 i) D5 L2 v9 D( e
- openConsole;' f$ ^; i2 q& r' M( x& Y
- 6 N& i( N0 t+ i; Q8 G4 a) j" A7 g$ k
- /*, S y' _% O: U \0 L$ v, K0 A
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
" i, C' e- n+ _7 Y4 b - when is64BitApplication then 64 else 32,
3 Q! I. `3 U0 t/ F' K8 _# A - "bit.dll");
% J2 C+ C0 b9 |' p! ~ - */
8 {% ~9 ? C( t5 N4 D4 J( B2 q5 o - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
" W4 Y3 Q3 A2 R5 W7 X* |5 E: e- i7 {& L - local j := loadLibrary(file);
# N. p, P. ~$ |4 z - % f5 f- L3 X7 L# r5 R8 G" d b
- if j > 0 then
* ~& a, A: q+ a" j) j/ Y - print getLoadedLibrary(j)," is loaded.";
: j6 v; `- j( s - , U/ M+ Z+ m; a( [0 R
- r := callLibrary(j, "calcSin", PI/6);, w6 P" T1 p: @/ `
- promptmessage(to_str("sin(PI/6) = ", r));: `0 v6 ^- m( l( r
- , _( p6 G; K/ t; R0 P
- local str:string;
/ S U3 e; p9 F) A( T1 A' x) a% d - str := "I'm OK!";/ g, u1 T G5 R0 q. j+ _
- str := callLibrary(j,"resetStr",str);7 C* ?& z( s/ p8 [. P
- promptmessage(str);
) e1 M( Y7 E/ `! s- E: C -
1 ^/ T' a0 G$ r( b& ^ - callLibrary(j, "listAccess", Tablefile);% C) m. p) b/ a; f
-
9 u6 |+ G$ F5 p# p - print "Unloading: ", freeLibrary(j);
3 R i. }; f8 C/ l4 p - end;
4 w) ^/ [4 j" p* M" m: T - end;. ?2 }# p3 ~5 ]/ ~3 h
复制代码 |