- is
$ w$ g; ]6 q- V# b, {5 ^7 U" l: n( _ - r:real; file:string;
7 C: p i" q) K6 E0 X( t: M( q - do$ J. c9 R6 C9 h3 w: ?' r0 }
- openConsole;* \! J' \7 I6 L/ T
- 9 F7 U2 \0 J4 _
- /*
: H1 P6 `. O( \9 n: T3 f* U - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
L* L+ F' F, g, w6 N' i+ z - when is64BitApplication then 64 else 32,* @3 x: z6 I$ x; P" `. i5 ^7 K
- "bit.dll");- a) S4 B. Z& h6 g& w' f
- */
5 d/ N% \( m3 J - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
& M! J6 C* p8 a( n8 j I( | - local j := loadLibrary(file);
) i* g7 t" o; l4 S* ^" L4 @6 r: p
3 X, f; N1 O4 b# D- if j > 0 then
3 r5 a$ O7 U0 T - print getLoadedLibrary(j)," is loaded.";% V1 T7 u4 T) {4 h
* A! Y/ c: y) B# u. g: B- r := callLibrary(j, "calcSin", PI/6);
8 g) n* Q) h$ O1 c' ?' H - promptmessage(to_str("sin(PI/6) = ", r));. b9 y; |4 K3 R2 }5 j# L/ d
-
. J Z( t0 P' z - local str:string;, _9 ^- J6 O: k. k
- str := "I'm OK!";
' ~" g, B- t& d/ L& B4 w - str := callLibrary(j,"resetStr",str);+ k) h' w j1 I, @7 ]/ j! d1 y
- promptmessage(str);1 j- V: Q' G9 z8 w
- : V; [$ Y: k, Z; O3 Q
- callLibrary(j, "listAccess", Tablefile);# p6 F0 M1 G3 [/ t
- e/ z1 k9 y& g6 E1 ] L5 E
- print "Unloading: ", freeLibrary(j);7 \9 m6 ~4 Y! j% [1 q
- end;
/ v0 H$ B; T+ R8 L' `3 j$ J8 _) ?2 U - end;
: t4 y; ~9 s' W* O
复制代码 |