- is
. \, t( S4 w+ r, \' E - r:real; file:string;
2 X% }; S/ v2 m. I - do
7 o" ?: B* E/ ]& V* i( D8 Z - openConsole;' m% v9 z/ T# R/ q t: s
- ) U' q8 o1 j# D; l# d" p+ C3 F
- /*8 P5 Z; K3 b0 [
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
+ V) `6 x- H/ F# } E& L( I - when is64BitApplication then 64 else 32,! }3 \8 V5 o" ^/ m3 P4 G+ @+ V
- "bit.dll");$ ~, m& C' D- S" n6 K" u w
- */! h4 ^ Q, t, e' P
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
/ \; }8 [: ?; N4 f2 g& Z. J2 k5 @ - local j := loadLibrary(file);5 g* n0 D; I* j9 L" l
; B+ v) {. I4 c$ h% z g& _- if j > 0 then
) K9 S7 R3 I0 p# y# }! ~+ m - print getLoadedLibrary(j)," is loaded.";
( @' t4 {1 W- m. _$ C9 `7 Q5 t7 e
2 t2 `# S+ P* A+ J) g& r- r := callLibrary(j, "calcSin", PI/6);
[( M3 Y2 c% t1 ]- J( d - promptmessage(to_str("sin(PI/6) = ", r));) \. S8 p# H8 f% r. t6 c" O
- $ E6 v; s( ~( i9 r1 L; S, p$ W2 |
- local str:string;
3 f4 B e; `; h/ {3 U! c - str := "I'm OK!";' x* S. \. ?, @# ^, _
- str := callLibrary(j,"resetStr",str);+ P/ l$ r, y+ O
- promptmessage(str);
5 s/ c7 w; e1 ]" G -
1 l; ]2 `# ~+ I/ D( m, | - callLibrary(j, "listAccess", Tablefile);
1 y" p6 Y) S: t- ]0 A -
8 y7 K7 J+ S1 q" u' F, f - print "Unloading: ", freeLibrary(j);
# a. o5 o6 D6 _3 T1 m; w - end;
9 H+ Q5 S7 B; }- y: j9 q) I/ k - end;" w( y6 k1 X- x4 a( `
复制代码 |