- is ^" c `0 Y2 |; U& O P
- r:real; file:string;
8 D+ x7 ?% h8 a - do, B, T1 E' g: o
- openConsole;
7 R$ h; \ r. d% u; M) b% D - 9 p6 S& p& c2 Q
- /*
9 Q: z1 `8 Z0 N - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",! b0 D+ }; K- y" d9 _$ {3 D
- when is64BitApplication then 64 else 32,
: m7 @% `* }3 B( M - "bit.dll"); T% a4 {- ?; `, s$ q
- */ R/ V8 s1 ?1 ]* v- Z! Z
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll"; c% \ f8 m1 C# Z5 [ f
- local j := loadLibrary(file);
$ S1 @2 B4 {+ D6 Q8 \7 I' Z% O - ) G' I" ~ C L7 A
- if j > 0 then
3 k4 `8 S3 F" H - print getLoadedLibrary(j)," is loaded.";* p \$ E6 P# B J4 s2 _% s
- 2 N! s. v& T" m6 G+ m' T
- r := callLibrary(j, "calcSin", PI/6);
: I* e7 Z% n0 q/ W7 R+ ~4 S - promptmessage(to_str("sin(PI/6) = ", r));
' R' z: @5 B" v) S" r5 S - . t5 J, b) A* B
- local str:string;
. t3 `5 C: _5 U9 ]; F: K: y - str := "I'm OK!";- ^& ~6 r& ~- }+ ]) j" a
- str := callLibrary(j,"resetStr",str);+ C% E9 m8 v2 s+ W4 g; b
- promptmessage(str);) j0 u* U9 W, z( o. ?) \
- " U# O+ C* d& r& u7 N v( q; @
- callLibrary(j, "listAccess", Tablefile);! W1 a* `7 P4 M$ K: }! [( U
-
1 R* S; Y0 M. q/ K; Z% | - print "Unloading: ", freeLibrary(j);
" a6 c" ]) ^# j - end;0 e& O! R" ~0 b: n0 |# r' s4 h
- end;
! `7 U% i$ Q/ x5 x/ R- h$ J# Y8 Z
复制代码 |