- is
& ]9 w8 t$ s3 P2 u( N - r:real; file:string;. I9 P) E- y7 \0 M% e
- do; L. r p5 C+ P" A
- openConsole;& S$ ^ B3 u. B5 r; K8 @- K
- 8 ?# B8 L% m% [
- /*1 k% W5 O; c* T6 Q+ i3 Z
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
3 U7 G% P! w" [& }3 b - when is64BitApplication then 64 else 32,8 g* K; L! h) z: I) c( U
- "bit.dll");# j) }! N5 }8 c+ L
- */- i* x" j3 x$ b, F
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";$ D# {6 A) F2 q2 M3 V0 M: }
- local j := loadLibrary(file);
4 S9 Z0 V$ G1 }( t
/ c; u$ V5 m6 i- if j > 0 then
! v6 ]6 N2 I/ ]4 }! M; T4 \ - print getLoadedLibrary(j)," is loaded.";
9 R9 @1 z8 ^2 [& [6 w* D
7 {5 O9 }- W' H9 z! i& v0 C) m- r := callLibrary(j, "calcSin", PI/6);1 X: i" K$ {% Y2 a, A; v- B
- promptmessage(to_str("sin(PI/6) = ", r));
' E/ n0 o6 x0 A' Z. x5 J - 1 S1 [; d) q4 l# E1 b
- local str:string;
1 j! L4 o' y$ b - str := "I'm OK!";" p s. W, `8 Q' r/ x
- str := callLibrary(j,"resetStr",str);' |$ D1 b: b9 x& Y0 B+ g G, g: Y# n
- promptmessage(str);2 r6 ^% }6 g$ ^4 C, a
- 1 y: W9 d2 ^! I% Z1 N
- callLibrary(j, "listAccess", Tablefile);0 p! E, R& i a
- ' h0 r& d% a2 E" p# U! k9 T: r% j
- print "Unloading: ", freeLibrary(j);1 r& s, C$ h' S% I! {
- end;' `' k. _7 ~1 T1 M j0 `
- end;% e9 v& A# n0 x, L* C: M, T( S
复制代码 |