- is
. D9 V |3 Z4 t" X% X - r:real; file:string;3 p: I& O, m7 f: q1 L
- do
5 H: E, H. B3 K& d - openConsole;
6 v( R. _& {! J" n& g - 7 F- F0 q h; g4 a5 C1 T
- /*
1 a: k: O5 n* S - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",) E" }2 O# t' Q0 O# y
- when is64BitApplication then 64 else 32,
: e5 G E a0 x! e7 T, h - "bit.dll");, a9 @! i) d# z- r4 S- k
- */, r' N0 i* w6 x9 N
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
/ ?7 o" `# j, [. R, G4 a7 y. y - local j := loadLibrary(file);
+ }4 a% P T8 C4 t$ t' i& H
- n- _0 Z0 p [8 e) z8 x- if j > 0 then) v8 e, K8 i4 A; J9 H2 R
- print getLoadedLibrary(j)," is loaded.";* [3 K3 ?# x. w& w3 R/ a3 l3 e' h. p
- ( Z' e: v: {8 ]
- r := callLibrary(j, "calcSin", PI/6);: J0 p& e1 s2 I2 }9 x% a/ h
- promptmessage(to_str("sin(PI/6) = ", r));( C) d+ U4 l/ L( K! S
- : O: O/ w3 ]% O+ O: g+ c+ _4 m! I! s
- local str:string;
' ?' w; |% k2 _/ e$ F, I - str := "I'm OK!";' h( E, V8 b) O& z
- str := callLibrary(j,"resetStr",str);
# w. X+ M8 B3 c# A - promptmessage(str);' `( M; u6 ]- |+ N% G# [
-
$ A: e5 W) J/ }) r - callLibrary(j, "listAccess", Tablefile);+ |, u- V2 H4 [& K: c
- 9 T. {1 H8 p. K8 W' o9 {0 `8 l+ y' b
- print "Unloading: ", freeLibrary(j);: b5 {: E" _4 o; U" p5 d
- end;8 A( w, L- O" a) E1 j4 M
- end;& M4 W/ ^: S, _3 i* ]( Z, j. _
复制代码 |