- is. z1 v! ]0 o" n, {7 Q7 q
- r:real; file:string;" x S5 l1 N; w" a3 R, O! P
- do
# t$ a7 q9 k' k9 S7 E" ~4 ` - openConsole;1 a) P. ^1 i* k! V
- ! v; f3 B$ s! s$ w3 i* d b
- /*) n! }; g8 c( b( ` E( Q- |7 Q! \
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
2 x4 g) i! M9 b) ~ - when is64BitApplication then 64 else 32,
: b1 y6 t4 U: ~ t - "bit.dll");
, x* s7 o) ^& J- i1 L, | - */
# u+ y5 K3 X: A* P" s1 l - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";8 [$ P w% }" L- m" k( @
- local j := loadLibrary(file);
2 M! v6 L' a. K& Y1 H
' P& T/ _( s# B7 X9 ~6 a- if j > 0 then
7 H9 b# p) L1 c0 b) Q. T - print getLoadedLibrary(j)," is loaded.";' H: W1 Y0 T |6 | A( _
- * _' K( e/ m1 I5 U
- r := callLibrary(j, "calcSin", PI/6); ?; ^. h1 @3 e0 X/ H: |
- promptmessage(to_str("sin(PI/6) = ", r));
: n, F/ o* [, F) Y" g/ E- B - 3 Z) X# P4 x1 Q' I! M
- local str:string;) O4 ^/ r3 z# [( N. M# D
- str := "I'm OK!";. M F. ^$ q* z" p5 h" [0 p- W( |
- str := callLibrary(j,"resetStr",str);. }. t4 h4 T& I: L) Z/ W- ^, o
- promptmessage(str);+ `9 ~/ v" i; N
-
; W9 ~+ e3 z' Z - callLibrary(j, "listAccess", Tablefile);* T2 W/ Q" B6 n& {" H% `' g
- ! O; `# ]0 z* ]5 B" A3 C5 Q6 e
- print "Unloading: ", freeLibrary(j);6 q# I) P% m5 E$ i5 s; z+ {
- end;
! D% G$ B2 O5 h& V6 Q% J& P* l1 O( S - end;6 K; `8 Q2 \4 l" C5 K) c, F
复制代码 |