- is; N0 A1 B" i, V2 o+ W3 n$ `2 A
- r:real; file:string;
/ G: j, d6 s% Q) O3 L A, w - do' ^6 a: r1 Y$ r- {/ T4 Q
- openConsole;
B4 ~9 X0 V( [. A' r - % U9 s$ x* }( W6 S
- /*
* s' ]( c8 V( N- ~1 E. k2 ^; D - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
. f/ [0 p5 d$ O# g& T$ S( }( Y1 O - when is64BitApplication then 64 else 32,2 v6 u3 q; {& x! w! D( {8 }0 L
- "bit.dll");
9 W* c& }7 ]3 l4 B3 i - */
# k3 I/ K# F% D/ f" `+ X- M5 N - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";$ x2 D4 c& B6 c. H/ E- C
- local j := loadLibrary(file);
- A3 A& |5 v* l& P5 W
; f6 l; W6 I" [; W) P" w- if j > 0 then2 t+ e' l$ S% }; h8 e5 Y) D1 Y
- print getLoadedLibrary(j)," is loaded.";
8 W6 k+ k! ~, d3 v+ ]# } - 4 z& ~" S i$ P6 _
- r := callLibrary(j, "calcSin", PI/6);, W8 M' y: C' H' R% d% j" y
- promptmessage(to_str("sin(PI/6) = ", r));( f; _! l2 q- J2 R+ H3 X3 ~$ O
- + E" {( h( U. i4 j" X- W; X* \3 \
- local str:string;2 L! e6 i2 H* f
- str := "I'm OK!";
3 s( M7 Q& L3 [( N" V+ ~0 t - str := callLibrary(j,"resetStr",str); y' H* g8 y* @5 {. b" I
- promptmessage(str);$ m( {0 t: l8 \ z
-
* v* Z0 M/ }3 A* Z) G- W - callLibrary(j, "listAccess", Tablefile);
3 P! z! k) h9 `4 n - $ j8 d- m3 e* b+ _
- print "Unloading: ", freeLibrary(j);* g; O* E6 e, f8 o
- end;0 a7 r: z2 f9 D
- end;3 R! V9 k8 U) N% A
复制代码 |