- is
" t! {9 D' b3 K - r:real; file:string;; V1 G; V9 [; h' ^$ E" _" P
- do
9 L! I5 K6 I& h3 S3 |8 T5 r: W' r) d2 k - openConsole;
# c& I- _* x+ A& B7 {0 {
" b. p8 k" C" _- w1 A0 U l- /*
; i" I6 c/ S2 l) V/ |) l" f - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
7 c) ^9 u% L. ]3 g# V2 H - when is64BitApplication then 64 else 32,
) p1 W9 @4 g8 e. D4 J - "bit.dll");
; ^# y' `2 m, k; ?. B' R8 e, k - */
m0 \6 `# t0 n, @2 r# b2 w$ g - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";9 p4 F) A0 M# B" I9 y- r) K2 i" X8 J# r
- local j := loadLibrary(file);2 B3 r+ ? [& s: g& m8 f
- " _$ a3 e: |" [ v
- if j > 0 then
8 V. O U0 F. R6 { - print getLoadedLibrary(j)," is loaded.";4 \ i. c+ F5 }1 p7 q+ K+ I
- # J7 S* f+ j6 Z2 O6 X; v$ L4 `
- r := callLibrary(j, "calcSin", PI/6);- n# q' T5 E8 o! R8 [3 a) w
- promptmessage(to_str("sin(PI/6) = ", r));& Z H, T& O2 ~5 N1 j$ h/ e( ]
-
% J) Q- |/ n7 N7 [ - local str:string;$ E" R$ } t( p; O" W c& l" c
- str := "I'm OK!";7 u7 M4 V/ o" ]! a' F0 g( c
- str := callLibrary(j,"resetStr",str);6 h& B. t: y4 ~) Y- x7 d
- promptmessage(str);* d s# X- t" W. h6 U3 ^) \
-
' x! I4 R4 C' J0 X4 P$ R& L9 w9 R - callLibrary(j, "listAccess", Tablefile);
% E2 A% ~, f# M- l9 c) i l -
8 O+ J9 J7 {4 k X7 U - print "Unloading: ", freeLibrary(j);6 z2 y$ e# _8 @; R# H2 w5 f
- end;' v$ L" h# c( G6 y
- end;+ S0 k! J4 E$ N! V- g2 `* h
复制代码 |