- is
. v, @. k& S) X! g - r:real; file:string;9 i6 w8 j$ L# w7 G. j
- do2 e. q1 w, D# \4 D4 M5 L
- openConsole;
. O8 P% }# e `3 H* S - ' U: i5 s, ?) }
- /*
5 O, z: v+ l! }0 O( P7 u" l - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",5 v; i9 ~6 l, z' `+ e2 E
- when is64BitApplication then 64 else 32,( g: n* Z1 f, d3 u3 p2 d6 {& L
- "bit.dll");
- L" ^& a2 k' K4 O; Z - */* n9 P- J# S/ v6 D: L$ y8 e
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
1 u+ N; f1 i6 B2 x2 L - local j := loadLibrary(file);
4 ~! P; L) i1 B7 Q! o+ {
; K: ]6 R+ W r- if j > 0 then( k% y! K. k- O# {& ^4 L
- print getLoadedLibrary(j)," is loaded.";( b8 Z8 q1 S9 o6 A
' i7 ~6 H/ c9 j- H+ z' `3 q. M) i) G- r := callLibrary(j, "calcSin", PI/6);4 |! E; ~$ B( R; k
- promptmessage(to_str("sin(PI/6) = ", r));6 _+ {8 N( T2 g3 h$ T/ ~% R
-
y% R5 H7 q8 q4 A2 L: l, J" K& z - local str:string;
* C/ U' u5 Y8 K+ {! \8 G - str := "I'm OK!";6 j9 v5 I ]% `- N
- str := callLibrary(j,"resetStr",str);1 q5 b; T+ E3 y1 e
- promptmessage(str);2 N, n3 }# X1 k3 {
- % x# J7 Q7 a2 d8 P% o9 x. t0 ]2 a3 ?0 M' }
- callLibrary(j, "listAccess", Tablefile);
: M4 i1 z+ Q+ n1 {# u+ ] -
5 D- W! _: g2 e ] - print "Unloading: ", freeLibrary(j);
: E! F+ d) s5 ] - end;* @& U- b$ t$ z/ r2 v9 T
- end;( K" Q4 v2 `1 n7 q6 ~
复制代码 |