- is
5 ~+ ]/ c0 z' m4 b- l - r:real; file:string;
8 q; O) h& `/ k3 e1 \- z- Q2 e - do w* y& t: \8 F( c4 o0 t+ q: Y
- openConsole;/ L/ _0 b% N$ U- R8 t
' Q) ^1 p9 z9 y. p- /*
8 C6 g' e$ R+ c2 | - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",- M+ f3 V0 z; e$ ^1 d7 m1 K
- when is64BitApplication then 64 else 32,
- |, M- K7 ~4 F+ x - "bit.dll");$ I. P0 k1 n4 r7 Q0 ?4 Q% E" T
- */
0 h. P8 g/ v9 I+ y - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
' a+ q6 z0 X5 Q, h; L- ` - local j := loadLibrary(file);5 d# V* q3 \1 z& K0 {
$ ?! j' d6 W: d; m# `6 e' x3 ~. _- if j > 0 then c: [. |: K; _- D
- print getLoadedLibrary(j)," is loaded.";# j/ D8 s, b4 W+ h: e* I. Q
) B% l9 n. }" [9 N! L- r := callLibrary(j, "calcSin", PI/6);" ]- H% k8 K! {1 y& \
- promptmessage(to_str("sin(PI/6) = ", r));- _6 |3 J# g- z1 X- a, b/ Z( |" M
-
3 q. E/ K4 b! S/ A9 H: \3 ^ - local str:string;2 o s6 K" u7 q) l
- str := "I'm OK!";
g: b$ ?0 N: z, r1 w2 J* T4 U, ~ - str := callLibrary(j,"resetStr",str);# w' j0 Q% u( g9 K4 q
- promptmessage(str);
q7 Y! E" p4 n% J) L - - Z# i O/ l+ `$ Z* [
- callLibrary(j, "listAccess", Tablefile);
" N9 I, v2 F; G$ |& J4 b -
3 H% R3 E. c8 c4 M - print "Unloading: ", freeLibrary(j);
; R* m# P3 Z, M( @- T' l* f/ o - end;
* `6 W' W8 e; r% K3 B8 B( C - end;
; D+ k( k1 U0 X: e: v1 N4 X4 Q
复制代码 |