- is
q' a6 w& f T1 a# ~ - r:real; file:string;3 |+ c9 X9 m9 R% E8 Y' s/ ~
- do
V2 G" p" `' p* H - openConsole;/ G& F. U+ u6 }" M. ?) I
1 i; T' I$ z0 c) i0 a- /*
5 H# b: H# n x/ _0 n! G - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",8 @8 z( q3 @% W+ a# Z4 A. Y* ]- o
- when is64BitApplication then 64 else 32,
3 e7 R- T. ]- t; ?3 C1 J - "bit.dll");1 b) V8 T4 d. e- [* n: Z
- */4 ^+ P2 F6 L% c) K" g
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
3 J* ?% t, V: j/ ^ - local j := loadLibrary(file);
8 o1 y. S) b7 n% \
* {! a$ L1 N& n' S- if j > 0 then
, k. A/ B/ U$ R( X: E - print getLoadedLibrary(j)," is loaded.";( @6 c3 {% o/ b* n* k4 }- G
# V( Y! t4 ?8 R1 i- r := callLibrary(j, "calcSin", PI/6);) U5 i1 g) H" n" E$ \2 N$ B! {
- promptmessage(to_str("sin(PI/6) = ", r));% V% n' {- F1 U# Z& q
- 4 J) A/ B5 u- O2 [, j
- local str:string;3 n" H4 r2 o0 p9 g) f# O$ I
- str := "I'm OK!";0 |- n1 q6 d: i" s
- str := callLibrary(j,"resetStr",str);
) A; R) x6 J; Z% v6 f4 f - promptmessage(str);/ Q' N4 C( u8 m9 H
- & z8 C. r- }9 W# m
- callLibrary(j, "listAccess", Tablefile);
9 Y6 B, y+ j* g- X/ a - 0 C+ d0 L. W3 y. w+ X
- print "Unloading: ", freeLibrary(j);
6 j7 N; k+ ~( H - end;
; `. Q' U4 a. R( { - end;
4 m/ Y" e% I' G. O3 |0 t
复制代码 |