- is- x' I/ o; D2 U4 {8 O$ R; W
- r:real; file:string;
% T% W7 g5 t' H+ t - do) @- i/ h" T$ N% T- I! X# u( x/ F* |
- openConsole;
1 F/ j0 }2 U9 m7 z* c5 }* d - ) x# m" h: p& L: z6 x% p+ x
- /*
) I2 W" i* m+ c6 O3 o - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",2 T) C2 `! \# J5 n1 c6 c& S
- when is64BitApplication then 64 else 32,
) H* L2 s; z6 H g6 u8 Z$ Y" i3 c - "bit.dll");4 k' }1 Q5 b" N; \/ d( [
- */6 E' N0 g1 `. B) b! d+ u; j
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";- x. W( K* e' I# K- P
- local j := loadLibrary(file);
9 c& d( t* c6 P
3 R) k) }5 `" j. ^# ?. z- if j > 0 then$ ]8 w" \* ^% ~8 h0 t( i; u2 z5 u
- print getLoadedLibrary(j)," is loaded.";5 o) M, Q! O) y/ s
- - L! P5 b7 V4 y+ m/ F2 j) i7 Z0 p2 a, c
- r := callLibrary(j, "calcSin", PI/6);# W n7 N) ?$ q! i# O
- promptmessage(to_str("sin(PI/6) = ", r));
4 \4 L0 Q$ |9 x& Y( W - 5 v: J" P4 a9 h$ e! b5 e
- local str:string;0 y9 L0 @5 t* l2 l
- str := "I'm OK!";
! |$ }; G6 E) m/ S; f m' K0 h. B - str := callLibrary(j,"resetStr",str);3 `6 a( K0 D; Y( n
- promptmessage(str);; y' ^+ R0 z% Y5 M3 C. h# C
- 3 Z% e" Q1 f" c3 j
- callLibrary(j, "listAccess", Tablefile);
1 J3 u: R/ u: V7 G9 n' l; b2 {4 [; J -
& ^- ~$ ^ b( p - print "Unloading: ", freeLibrary(j);7 [& d" A0 b0 |
- end;
* t$ T* _! N. k* O" f - end; w1 F8 x! B+ c4 V6 J
复制代码 |