- is
4 l6 n0 n: t; B# o - r:real; file:string;
9 a# P" z/ j- @0 I' v S/ Y6 E9 |) { - do
9 ^! _1 K3 {% {7 b3 e5 Q - openConsole;
! b& h" h$ C2 S6 |) q, ?9 G/ Q, V+ {
# w/ s7 ?4 q1 _+ M) u& h1 u- /*
9 Q% n: y7 q$ T$ o5 J3 ~! O2 V - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
: A' |3 J1 x5 T6 T4 f2 a- g { - when is64BitApplication then 64 else 32,
?3 g* `4 o( v. W - "bit.dll");
e- [4 i, S- b I2 b& [% C - */9 Q; y# M* l( t" A9 A
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";# `, i" z4 t. i |+ v9 E8 P7 U7 I, w
- local j := loadLibrary(file);5 j# o/ F1 @% C) Z+ p
- ) Z: c* [& ^1 e' T: f* N
- if j > 0 then7 q* H2 L% L% N0 U. x: v# p y
- print getLoadedLibrary(j)," is loaded.";! A- f% L6 Y; x# S, \/ R7 k
- . }2 \6 t* k3 A5 D9 A- Z* T$ ^
- r := callLibrary(j, "calcSin", PI/6);
j) o5 \8 C3 r - promptmessage(to_str("sin(PI/6) = ", r));
j) C5 Y" w8 W; f" M" A -
7 X0 I) T$ U% E4 `6 T6 V+ O ] w - local str:string;
! s# g# z$ Y" L+ L5 n+ r - str := "I'm OK!";6 Q% Z% [6 ~: G& A' u H4 g
- str := callLibrary(j,"resetStr",str);( r! H# E- M3 ~3 l7 P$ N- E- u
- promptmessage(str);
5 v" r+ Z9 n) n! {9 | - % C: o) b5 X; t: z
- callLibrary(j, "listAccess", Tablefile);
3 }9 Q2 _4 Y- n9 V9 J8 a* O* ]* ~ - ( I8 t& D' k) B" z; l- E
- print "Unloading: ", freeLibrary(j);
6 z& n% u1 o% U% J3 ~: n/ S - end;
/ M9 Y" ?) l) B/ y& W1 j$ ]0 x - end;( w7 i0 N( I8 g
复制代码 |