- is
/ Q4 b( s5 `7 _6 }8 ^6 Y* j - r:real; file:string;
. r, r7 l( w2 J( [% p6 ]) o - do+ O1 n2 _4 G$ C3 E0 R8 R- n% z$ o
- openConsole;0 m9 i! [( v* j: V: v! b1 H
- - Q$ {2 S; j ]) ]/ {" T
- /*
0 W" [# |$ I7 K3 l - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",& c) z& }& K* U8 j: o
- when is64BitApplication then 64 else 32,8 `0 G+ T# i& ^" p
- "bit.dll");
: v- H# A5 F# s4 z- [* w - */: \9 W8 [1 V. w
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";$ p) O! Q# m) E% {$ e. @9 a1 q
- local j := loadLibrary(file);! Z! o# f, f. S0 Y
& Q- Z1 m' F: H9 E# Q8 W4 I4 K- if j > 0 then
_ {3 I: j% j& F - print getLoadedLibrary(j)," is loaded.";
! y4 A" A- ^* Y! Y2 i: L( A" r
" ^! I% ]- B; v& k' X, ?- r := callLibrary(j, "calcSin", PI/6);
7 J8 c: D1 Y7 J) i* I- Q - promptmessage(to_str("sin(PI/6) = ", r));( X6 |6 d- N. I
- ' n3 [) D( Q# X, D. w% A9 N! `/ M
- local str:string;
# k7 S* c8 [5 o U- r2 P9 e) b! f$ J; X' h - str := "I'm OK!";" g* d& s V* z" u/ i
- str := callLibrary(j,"resetStr",str);! ^- S: u; c9 N
- promptmessage(str);
8 R% h% h2 P$ w/ v- n -
: \* r) H( H# ?, C/ p* g - callLibrary(j, "listAccess", Tablefile);! ^# V) C. M1 H1 f" t4 n8 n
- 8 g t) u7 ?" ^* w B+ k
- print "Unloading: ", freeLibrary(j);5 ]7 f& }* y4 ?
- end;. o! |, h5 J8 \3 V& |9 b" O1 ]
- end;0 t4 T2 Y/ t# X# X' O$ g
复制代码 |