- is
0 C, g' l5 O9 y; O$ n9 \ - r:real; file:string;, @' {; T8 j* R# C( ]6 Q: q# y
- do8 t$ J3 S2 r6 u. C- r
- openConsole;5 y1 _5 p. s. \2 B+ M$ g7 \
- & i3 L+ k; w5 q. w
- /*
! N" b9 j3 N/ b$ A - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
! ]9 q7 s5 z$ k- Q - when is64BitApplication then 64 else 32,
# J Q! }0 K& l# | - "bit.dll");
5 F5 f8 M3 Q$ _* x6 A& y - */
, u. Y+ q7 g t% \3 c8 N: Q - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";1 n) ?5 ?4 ?: w4 h' k3 q
- local j := loadLibrary(file);
' N; ?+ ~, ^8 ?8 T n4 g y2 W
) d0 N! \$ L6 h: r8 P- if j > 0 then' v2 u# [$ _9 E6 K$ C- a
- print getLoadedLibrary(j)," is loaded.";6 [& A) S; a5 Q- c! G1 ^
- ~ v% O. R6 T3 s& d- [- r := callLibrary(j, "calcSin", PI/6);
( l) d! S9 I( K! r/ ` - promptmessage(to_str("sin(PI/6) = ", r));
1 B4 p2 \' R# {4 n2 a - ; f2 z6 ?* H5 ?/ U
- local str:string;* f. z. {, U* u, q! c
- str := "I'm OK!";
, i' }4 A" B4 W1 w - str := callLibrary(j,"resetStr",str);
9 |+ g+ V; F; C/ |9 v' E9 D - promptmessage(str);% E) m, W5 Y& C9 u
-
) k% b& m4 i. W G - callLibrary(j, "listAccess", Tablefile);0 y' s& B2 a% S; W, v3 c# H& y
-
/ q" R; I8 d3 C, h' e0 m) l" F9 g - print "Unloading: ", freeLibrary(j);
% |" G( c, C+ R/ x - end;
; ]! ^4 G. ^( d - end;
* v: C8 \* O6 r- T/ f' S, r
复制代码 |