- is
5 ~5 R' T0 _ J% D4 }% | X - r:real; file:string;- A9 Y# ]4 X1 _- c
- do
3 x$ Q, c, ?9 C. F; a - openConsole;- h5 t" ?6 d9 D5 K5 ?: C1 ]) X
- - G" @3 w5 q" C9 d4 P3 h; s
- /*
* L% u6 q0 @( l2 ~9 u - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
$ Q6 {0 w/ `' N, C - when is64BitApplication then 64 else 32,; C5 p1 Q0 {: t
- "bit.dll");; }( K" r \/ z+ Y5 ^6 ~* e
- */
/ v& k6 c5 y! G E - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
$ G7 H* I+ \: E8 m- I - local j := loadLibrary(file);" B% l1 l4 D5 f/ y2 j: c# Q, J7 o
. s# R8 R6 p0 X4 j [- if j > 0 then7 s1 R1 y% }/ V! `7 p
- print getLoadedLibrary(j)," is loaded.";$ D' l' G( ^+ I9 q
# H) I5 [7 q! @; Y- r := callLibrary(j, "calcSin", PI/6);
; `$ J% ]3 F+ r! ~/ x! r! x - promptmessage(to_str("sin(PI/6) = ", r));/ d& R! J# ^, q! H) ^0 y! `" b
-
2 X# V, r8 W! { F - local str:string;
4 `$ N" y$ r7 C3 z- ^1 H - str := "I'm OK!";
7 _6 I; z. ^/ z; H% R - str := callLibrary(j,"resetStr",str);
% g9 g& G% Y: r9 x - promptmessage(str);
7 c1 o7 u3 j! G& }" } -
0 |3 X7 M* o! { - callLibrary(j, "listAccess", Tablefile);
3 ? F! e$ u$ X# i8 O -
5 _. @( _* q w5 x0 ^- O+ O - print "Unloading: ", freeLibrary(j);& N* t7 Z" w w2 s: G4 u
- end;3 @5 {) I; U9 \7 o2 Y
- end;
% p1 e7 S+ u0 M& v X- D5 L
复制代码 |