- is
! v3 n2 v- |# D. h - r:real; file:string;
! K+ {: {2 h U6 j' f$ S$ T - do2 [7 E# S& _2 y( e
- openConsole;
0 }, M! _4 Z$ r) e' E2 I5 l8 a - 8 g, ^8 v; P: Y4 y U
- /*
& m2 d3 D9 K/ J: \( r/ k1 _ - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",/ o3 {" k% o& J& @) I
- when is64BitApplication then 64 else 32,
; H$ j5 L- Q& b - "bit.dll");
: L5 _+ F, g) T: e: `) Z+ W( k0 ] - */2 K4 c& _4 d7 P' M9 |! P* I9 W
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
2 a0 w6 {+ u/ f3 T$ z; K - local j := loadLibrary(file);% D, H0 _$ I' q/ ?
" R: Q3 F% h8 q7 a- if j > 0 then
- R$ q3 n; i& D9 P+ o2 R W; Q - print getLoadedLibrary(j)," is loaded.";
2 H* L2 J* r% a. g! f
) b2 u! T& {4 | P" [- r := callLibrary(j, "calcSin", PI/6);
3 w; j, x; t/ v - promptmessage(to_str("sin(PI/6) = ", r));8 O* N6 W: I( v) Y) e
-
p+ n2 p% A4 R. F: f: f, Z - local str:string;
. @: j" `8 W' b& M4 h0 @5 ?4 ~" ? - str := "I'm OK!";4 ~, Q% Q! Y8 x9 _1 L
- str := callLibrary(j,"resetStr",str);5 s ^( X) q/ m& Q2 q* J
- promptmessage(str);! B) t& q3 w$ `
- - q6 E$ f8 w# ?! L9 T# s
- callLibrary(j, "listAccess", Tablefile);; x+ W8 p! G+ ^) j3 k
- % l- D- H( y0 k1 }! _) u
- print "Unloading: ", freeLibrary(j);
" O, M0 a- c/ J' r" s - end;, ~5 I* _' {- Y( J3 A
- end; e# J! s" {3 z! p2 a) `
复制代码 |