- is' q) e% t7 f9 k, c
- r:real; file:string;
3 z$ Z2 W* ~% q - do+ ~) X1 A# H& M: q; c
- openConsole;
7 \2 i5 K7 I6 ]5 |' \6 I - 1 E+ c- Q( S8 f/ g
- /*
4 Q3 K6 W% A$ N! D5 R4 L - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",# ]) R) U0 v2 u/ A, r
- when is64BitApplication then 64 else 32,2 r& Y' d/ [4 f) j/ R2 a% D2 Z
- "bit.dll");5 d) s( s7 d5 I
- */! w: m7 p. [3 t, s( y) j4 C2 }
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
: Q: ?7 k) n/ |6 A7 K - local j := loadLibrary(file);
2 Z, [8 J3 y) y8 u
7 ~* Q3 m' K: M9 j- if j > 0 then
+ `, |( Z; a& k% I6 r z2 I# G! w - print getLoadedLibrary(j)," is loaded.";
$ ?% h" s2 [ m3 V/ T- I - & }) j1 x+ ]! w8 M: z: S
- r := callLibrary(j, "calcSin", PI/6); i% d5 ~! m# ^* e2 U2 ~/ \1 V
- promptmessage(to_str("sin(PI/6) = ", r));+ x. i5 U9 d' {" m) Z
-
% I' W* [8 V- n# T - local str:string;/ i, N2 }$ P& `5 ?4 w( X
- str := "I'm OK!";
( Q% O, `1 Z. G4 n - str := callLibrary(j,"resetStr",str);" [7 T( s3 o; ?
- promptmessage(str);; y& ~9 k" O9 I' L9 W# R
- / ~! R! L# Y+ D. a% N
- callLibrary(j, "listAccess", Tablefile);" \% U3 G6 d3 u* v9 u
-
# F3 l. ?! m9 ]6 u - print "Unloading: ", freeLibrary(j);( ?6 F) m U* f/ M9 I" @
- end;- S4 \3 r. t! s& @: Z6 {7 x, u% `
- end;+ i4 D+ G0 _- Q r/ \6 r/ g
复制代码 |