- is" c$ C" V, O9 `! {+ l- ~
- r:real; file:string;0 |8 {" U1 x% X1 _* M
- do
+ n Z$ X# Y$ A# B8 a( P) r( a - openConsole;, _# N) o7 ?7 |4 c
4 u6 C$ N1 E/ J$ `6 ]5 \0 }- /*
6 d0 g# B% m2 G1 w$ j - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
5 U& ?% ~0 R4 s: z G4 D - when is64BitApplication then 64 else 32,+ w1 c2 G+ _/ D# `
- "bit.dll");
( V5 ^2 ?0 Z" u R% e - *// K0 G+ n0 w. [
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";4 g( x: n7 u( \1 t
- local j := loadLibrary(file);
1 n! e1 G1 r; W8 B+ e
2 m T. z2 Z( o- if j > 0 then
# } S: m$ F& L: m - print getLoadedLibrary(j)," is loaded.";
( o& U0 D9 \8 o- o: b) K - $ |; ~* _( \& ?
- r := callLibrary(j, "calcSin", PI/6);; S5 H2 `2 ]: ^0 g" x" y$ Q, |
- promptmessage(to_str("sin(PI/6) = ", r));+ j3 ~: U2 W* E& G9 y/ Y0 [2 h
-
8 u! g0 Q) @' C" e0 g - local str:string;) v6 h3 w1 d& k8 r2 M
- str := "I'm OK!";( N3 }, _7 u* x8 |6 X
- str := callLibrary(j,"resetStr",str);
+ ^0 J+ N y& e& a% } - promptmessage(str);* m+ [2 I l; t
- ; }5 i4 w8 @$ L: k
- callLibrary(j, "listAccess", Tablefile);- S9 N/ H4 {/ H9 D# t, ?* P6 ~
- 2 T0 a- t1 x' I- [ p: q3 Y1 P+ n- b
- print "Unloading: ", freeLibrary(j);% m3 E, Q+ W2 o- n
- end;
7 {: Z. H# v* N - end;
% ?6 h; a: N# Q: d4 C
复制代码 |