- is: J' t& F, `, M/ L4 t( h
- r:real; file:string;
0 N' j9 Q7 G5 V& i5 e+ s+ _; Y' V9 u - do- V, k- H+ a4 j* O1 _4 g3 H8 ?
- openConsole;
; d: q3 D* F$ _" v$ {: L$ ?! i - + Q* Q, {8 O1 p, d$ ]* U; c
- /*" a1 _# I, [ O# ^
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",7 I9 b% E% u) h) j6 i
- when is64BitApplication then 64 else 32,6 O$ U* c* \" \7 G6 O( k
- "bit.dll");
. H D5 a* o0 b - */
: b) {" q p( V0 W8 [/ P - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";' e8 h6 @& g9 F' t% b7 n
- local j := loadLibrary(file);
; r! Z0 v( T: ?& L+ } - : ]. w7 M' O# v. O, i0 Y
- if j > 0 then: S) \4 k) F4 i5 r5 y
- print getLoadedLibrary(j)," is loaded."; r8 Y5 G2 D- a8 y/ B
8 ]$ _! c. A9 @% B- r := callLibrary(j, "calcSin", PI/6);
, d( |: l9 u5 p% ]) ` - promptmessage(to_str("sin(PI/6) = ", r));; {* j8 G6 F% m
- % P: R+ u7 i- [7 b+ U U5 d
- local str:string;: N+ F7 H. @ T6 n; Z' m
- str := "I'm OK!";1 p) T9 W) M9 l' g, h- v2 ~) x2 v( t$ i
- str := callLibrary(j,"resetStr",str);4 o4 E0 M* `3 v9 ?& s+ Q- p
- promptmessage(str);# K! _ k8 N+ f& d* H1 P7 g6 `6 h
- & n. N/ |6 u# G0 U! O
- callLibrary(j, "listAccess", Tablefile);
4 C, @1 }& W1 y0 v- V x - ! J5 P" n* B6 Q8 y; p4 M) b
- print "Unloading: ", freeLibrary(j);0 l7 e3 W2 J& c" d
- end;# J4 [) y- }8 X
- end; K- c: P0 h) ~3 W R9 y! l. ~' ]
复制代码 |