- is
r# R6 F/ \, G6 ~3 K - r:real; file:string;
) X3 Z+ @! O' o1 Z5 v4 h - do
9 m- _6 Y1 m9 W! `* O" I9 f3 Q - openConsole;* Y# N% M( E* M) }+ m$ _$ k
- ! c. P1 F- ~- }) z/ s9 `- q7 w
- /*
4 k: U6 E/ [0 H' c& b - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
+ w5 I! G ^1 T! I7 V" @ - when is64BitApplication then 64 else 32,
1 o4 ~+ C- q, @) u - "bit.dll");" _8 z7 D7 m6 r; l) c" [1 S
- */
2 E- o" {- f+ h% ^ - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
! d3 [* d& g5 V# |# L* z- R - local j := loadLibrary(file);* q+ u- B1 T7 A+ j }
7 W3 \; E o& i: F( ?. d; q! [! u1 q- if j > 0 then
3 ~ t5 N$ X' C( j) [- v5 s - print getLoadedLibrary(j)," is loaded.";8 Z$ Y2 }- t7 n, z+ m
- ' B& E' i$ b5 Q; Y4 U$ N j$ l
- r := callLibrary(j, "calcSin", PI/6);: g" i+ J; W% E5 P1 B7 @$ d
- promptmessage(to_str("sin(PI/6) = ", r));5 W8 ~/ `! e2 `: t. b& U( V' m
- ) Y f% i/ @1 O6 m4 Y
- local str:string;
: h6 e' Z4 c5 L& x! _* ~7 B - str := "I'm OK!";4 N5 [* U4 w; O
- str := callLibrary(j,"resetStr",str); H" I1 \" I( T |' g; R5 H9 Q
- promptmessage(str);- F5 y9 e5 G8 [7 K6 B+ v
- [' S ?, w. e7 V: v. \8 r: F; U
- callLibrary(j, "listAccess", Tablefile);
% o6 h& @1 L9 { Y- u8 ]% ^ - " R; p! V7 R2 d9 u. U# m
- print "Unloading: ", freeLibrary(j);
. t+ u* g7 ]; u7 d( k% C& }7 ] - end;
7 J1 s: w# o& q5 `& ^ - end;
' j! G! _& v: N- e h9 K
复制代码 |