- is
/ f) O# I. C4 ]- T; |! n H5 [* g - r:real; file:string;
0 Z0 d. i8 ?- Q' `; Y& _! n - do
( n' w" [5 R9 u G; H. b, ` - openConsole;) m3 w- n. [! V+ m- k
$ S+ @: A$ Y5 E! y H- /*
" X; p; c5 P7 _" _: S. j - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
$ n6 S# o/ J$ a% M& ~4 K. ^! | - when is64BitApplication then 64 else 32,
' I" E6 l' o5 V( z" ] - "bit.dll");
6 c8 {5 i6 ?* G) i! ] - */
" S1 z; b/ c. ?6 J# L9 R - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";1 g: b7 V2 P1 v! a% F3 q; L
- local j := loadLibrary(file);
! O6 [6 [! |5 d
2 D+ i8 C: X& b: h% i5 |& o7 k/ f4 c- if j > 0 then+ n* `- _* d1 B+ B4 |
- print getLoadedLibrary(j)," is loaded.";0 |8 ~# L# N, i; E
- 3 P* T7 M! ~- }2 J$ z
- r := callLibrary(j, "calcSin", PI/6);. |) Q/ X3 f9 I" M
- promptmessage(to_str("sin(PI/6) = ", r));
, h: [0 m5 {$ t/ n$ z; i -
" H. m8 L% c! v7 l5 Q% J - local str:string;
/ k: V. G0 W( X - str := "I'm OK!";2 N" M/ ^& X) \: V
- str := callLibrary(j,"resetStr",str);
/ Q5 R, P+ s; S- ~# v - promptmessage(str);( ]! M6 y* o* ^
-
+ z1 ?2 _2 x+ h+ [" _ Y8 b - callLibrary(j, "listAccess", Tablefile);, g$ `6 L/ z1 E
- / q' W: }% \6 q& E1 J
- print "Unloading: ", freeLibrary(j);
: v" u. o/ c0 ` - end;
! J: H& ?! C( ]1 Y |+ A - end;4 }& X! y0 y7 J% Y* \
复制代码 |