- is
3 e" o. _* _& X: z% p# O - r:real; file:string;+ ]1 E, y5 B" p) j7 _
- do# n4 r$ i- x4 `9 @# Q3 \
- openConsole;
* B. G; c4 L8 z& C# T - 2 d) S+ {6 D# {8 I& T2 R
- /*
& y0 p& L2 J; `" \; W - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
' c7 m; v8 H4 l1 X" ^# F - when is64BitApplication then 64 else 32,3 R7 W! z4 R( X. k
- "bit.dll");1 N# Y2 U+ ^, v5 d
- */
7 C5 S8 ^7 g6 P" T, C - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
, j* P% d0 I7 k - local j := loadLibrary(file);' S; w4 z% j& l. v
- % `( E6 A) @4 u1 P" @- G4 D
- if j > 0 then
! H4 u: u; w0 F$ }2 X/ u) D% G - print getLoadedLibrary(j)," is loaded.";
) G' r: ]6 W9 H3 d; H+ L( e
! ^, w: v/ C* C7 I- r := callLibrary(j, "calcSin", PI/6);
/ p! u$ e- E \* g$ \& I- P2 b - promptmessage(to_str("sin(PI/6) = ", r));7 j2 Q! f G. ?
-
+ z( O* F& |9 b# G7 x - local str:string;
A; t. h- _9 d& B - str := "I'm OK!";* ^$ X/ K- j3 m5 }$ p7 C# ^; K; a
- str := callLibrary(j,"resetStr",str);$ {, w% N& I8 ~3 E( K
- promptmessage(str);. {* V3 U/ b* l: d
-
% Z% a* ]; r3 Y8 N& h, k1 Q+ ^6 n - callLibrary(j, "listAccess", Tablefile);
`3 Z8 [" h- G) [4 m -
]$ ^7 [' S' H/ m# l - print "Unloading: ", freeLibrary(j);
/ j/ J* _) A: P' E7 G5 i+ g9 ?8 u - end;
- p: U" E0 a9 g2 T9 V7 i4 j, T - end;- @" o1 [/ z7 t
复制代码 |