- is
* }% N+ H' G N% `( } - r:real; file:string;
+ I4 Q1 a/ a% M3 ~/ b; u - do) N0 W' i6 b4 o- T9 J j# D
- openConsole;7 C$ G- }' Q5 T P$ P2 _8 g. y
- 0 I" D2 X v$ \* J* L1 N
- /*
. u* `- I8 ~; e3 H# B3 P - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",+ s( ^& o+ i* Y( v$ g
- when is64BitApplication then 64 else 32,( c# b$ F# k: ]) a+ b
- "bit.dll");
5 q2 l) L$ a0 o7 ]0 c0 F) B; Q+ ` - */6 L9 L* d: S8 p
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
3 I/ [) K H$ T - local j := loadLibrary(file);) \/ Q, g7 p0 Z# w
- ! f& u5 ~6 ]2 V! r* L7 M8 S! _( S
- if j > 0 then5 f- l: S, b1 O
- print getLoadedLibrary(j)," is loaded.";
2 w% O: |3 ~3 v7 f6 g* u6 U
2 N) C- l3 K* R4 ~; g% T) K1 v- r := callLibrary(j, "calcSin", PI/6);
' H" P n# u! ?4 i - promptmessage(to_str("sin(PI/6) = ", r));+ U N$ ~7 U- u/ X7 _% s3 Z6 P
-
' J$ |' l4 W) b- d6 A - local str:string;- R" p' J3 f7 D" R6 ]. h- |
- str := "I'm OK!";6 G0 ?( n9 [( Z9 b' l& `
- str := callLibrary(j,"resetStr",str);* j8 B3 B* m9 |# y: B# D9 H# C
- promptmessage(str);
: m6 z' V5 |* x! E - ( S/ v1 J3 j$ Q; S/ \( n3 K
- callLibrary(j, "listAccess", Tablefile);
) `; ?1 {" }9 [' f- y7 e -
% v; S- F) ?% X9 ^5 Q/ \ - print "Unloading: ", freeLibrary(j);& H; h4 f' w8 P7 S
- end;! F; K3 a; b3 P2 J! d/ O: R1 U
- end;$ A& z* F4 N* X' D
复制代码 |