- is
/ l0 \- Y5 B$ `( e0 t+ @ - r:real; file:string;
+ f9 R$ C2 v0 E4 c - do
. u5 ~( ]- G) k/ T' V6 P/ m - openConsole;6 Y& n3 |! d6 M& V4 C8 w* o7 j
- 3 w5 D4 F/ w( L1 G7 l! e# ~' {
- /*
2 H- T* Q/ j) T$ g - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf", R) d- w- n; @# \0 c. e
- when is64BitApplication then 64 else 32,# R: R0 p1 a" k$ N
- "bit.dll");; } ~5 {& q, ^5 v, Y
- */7 A- R$ X9 g. }0 S
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";' n d9 _5 B" A! K# t- u0 k
- local j := loadLibrary(file);6 q5 V" O4 i9 V a
- 3 g% ^* c$ G+ b! @9 n; B C
- if j > 0 then
6 _% e! u6 ]% S4 J0 ~+ v: B - print getLoadedLibrary(j)," is loaded.";
) H, P* @% q8 k$ y$ I; Y G - N4 g# N" q8 y! K3 \* |3 U% h& j
- r := callLibrary(j, "calcSin", PI/6);
) q# h+ a6 l/ I; g; } - promptmessage(to_str("sin(PI/6) = ", r));
8 [ K, T n' z. {) d( Q# o - 2 z: [4 I6 L' j! J& m
- local str:string;$ d, ~5 U- _' R J# m' Y
- str := "I'm OK!";5 h! u& p) e, P# ~
- str := callLibrary(j,"resetStr",str);* F* x9 E. o: E* Q3 t# k% w# e% Z3 K
- promptmessage(str);6 K4 ]. Q7 L& p7 p( @
-
( v# X6 H. v! y4 O8 W# D& \& T% w - callLibrary(j, "listAccess", Tablefile);8 d$ h2 d, W9 Z8 d$ f( P, g
- 9 D+ [! S( N$ F! M( D% E
- print "Unloading: ", freeLibrary(j);0 u3 a, l' p* X3 G* s. V
- end;
* @6 v' y" x5 K1 ~7 U - end;
& m' g9 E. o0 _6 s4 b" R
复制代码 |