- is
2 m: Y# o2 z4 A; l; A7 p - r:real; file:string;( z z* z( J. j# H T
- do6 N4 c3 b- r( `6 H9 u7 t
- openConsole;2 N: ^6 ^, I# o1 z& e3 J
- 6 \: G" S7 n! O& @2 [$ a
- /*
n0 m! ^; `5 H' t7 F - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",) K. b) n ` l+ g$ q1 r
- when is64BitApplication then 64 else 32,
* F" D. f) w' p5 t6 r4 | - "bit.dll");
% N* f$ x" G: i5 P" Z* m - */
g: K$ Z7 r- A! e3 h" e' h - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";/ e" N4 ^& d8 o& o: H
- local j := loadLibrary(file);9 P; U$ j1 ~; e% U: J8 V4 {
' c# S1 I$ X8 z( g0 o, ^- if j > 0 then: A r4 g/ ?8 [3 u4 O; z
- print getLoadedLibrary(j)," is loaded.";; q b1 D5 l1 M. j% X7 O0 B5 W
- 8 w/ H' f0 H* y! g6 f
- r := callLibrary(j, "calcSin", PI/6);4 N: G9 ^3 U. O6 i% H9 }% s6 Y
- promptmessage(to_str("sin(PI/6) = ", r));# h; F. s' k/ c( x) `+ ]0 S& L& R
- . {- Q. H/ Z& \. ~, R7 r( ^/ ?
- local str:string;
7 ~' Q2 h0 E4 g' B; h' v7 u/ S - str := "I'm OK!";. [- h. d; D3 p/ m( W$ @
- str := callLibrary(j,"resetStr",str);" F! q5 Y* P! f1 C, b, q- z. g* C! H
- promptmessage(str);( ?9 @8 R4 B, [8 u) H+ S7 |5 ^
-
. q1 ^* F, n) q( R& i; _# r4 d$ \8 ` - callLibrary(j, "listAccess", Tablefile);
# N/ P; W# W2 M+ k! O -
) J8 B! ~$ ]- V) G - print "Unloading: ", freeLibrary(j);
4 c! L) `9 L8 l' _ K9 r, @ - end;
6 j% ~% L$ L! g6 {9 W/ g - end;
3 U y5 D- h! ?8 u& t
复制代码 |