- is
$ H' e+ \0 @$ Y1 d! n - r:real; file:string;: ^; X1 E' Y6 b+ x9 h
- do* F/ z. A6 O/ b1 h* _9 o
- openConsole;# K( i$ I+ d) A7 c! [: x! ~. ?
- ( R. z, U v; C" H1 {+ y
- /*, T3 O% e1 P; P% U5 |
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
; ~* X/ f) D" S' S - when is64BitApplication then 64 else 32,
1 h4 L* p3 D; B) K7 x# i2 O - "bit.dll");
' M, `5 @4 l7 Y& l/ C" v - */; R8 a, {* C4 Z7 q+ H9 A" a1 D% j
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
) c! D$ W$ ^, n; s4 C8 w- }7 D/ E - local j := loadLibrary(file);
. \- z' p1 O: s3 X# g - ( {) I6 s) l& k& u$ t6 B+ Q
- if j > 0 then
3 L9 d# y/ \: o' Y+ V, s1 r - print getLoadedLibrary(j)," is loaded.";
8 ]: k1 w. z" X( c9 R( ? - 9 @5 d6 A7 n( x
- r := callLibrary(j, "calcSin", PI/6);' M" r; M: m1 t9 l2 E& f" _
- promptmessage(to_str("sin(PI/6) = ", r));& U- F+ z. t, Q
- . @. `1 o4 j3 O) e& | L
- local str:string;
& t+ J) m; O/ x/ j - str := "I'm OK!";
( {& n: H4 y% F2 W0 A - str := callLibrary(j,"resetStr",str);
: E' j4 u* d- ^8 m+ ~- X' B8 q - promptmessage(str);
: \# k! k) ?# b8 K/ E* M -
5 z# d; N( S1 H e6 c- b* \7 m( `! S - callLibrary(j, "listAccess", Tablefile);' k' u" W4 N& ~' V6 E1 `
- & ^8 W h, i. w1 q; G5 ? x
- print "Unloading: ", freeLibrary(j);
' S# X% ]& J' x& b+ z& O - end;
, w, z- M2 Z& w; C - end;; r) E0 _( a/ k0 C& Z) L. f
复制代码 |