- is
- N" `4 c) K& m9 b - r:real; file:string;
1 k5 F6 t0 r8 }+ _4 \3 @ I J - do& n) P- T/ m% Q$ ~& K6 T2 {
- openConsole;
8 G$ U k- [+ P6 w - " V* [* `) m' P' a3 d D0 ^
- /*7 i. \' k. c) [# [3 E% ^
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
1 ^) t# ?. _9 | - when is64BitApplication then 64 else 32,& Z' F+ r, j9 y2 w% E* V9 W: L
- "bit.dll");
5 y% y) [% X) _# C, u, [ - */6 J$ g- H5 D. V! e6 o) h$ K+ U
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";! q; Y- F8 {" X
- local j := loadLibrary(file);4 F9 S; C( J6 d( `% t
- 4 E' i- i& \0 n
- if j > 0 then$ r$ y. p/ W! a: g
- print getLoadedLibrary(j)," is loaded.";: X6 E+ y! B" a9 Z$ A5 e0 k7 v8 _
- * ?0 w+ H H6 d
- r := callLibrary(j, "calcSin", PI/6);
5 V. _1 e# j8 {4 {' o: } - promptmessage(to_str("sin(PI/6) = ", r));
% a& h" y3 }* L# y4 f% ? - # v' g3 U9 m3 s/ Q, k
- local str:string;& Y' U* Q: ^: _9 x
- str := "I'm OK!";
. s3 e; C: R1 b1 z - str := callLibrary(j,"resetStr",str);& ]9 ~- j( b8 k- X S& m
- promptmessage(str);
) a0 p, o `2 z8 x$ B -
8 F' \# a( E# Q1 p1 X7 W - callLibrary(j, "listAccess", Tablefile);
+ P$ F! t h$ O9 Q - 8 m- _% R3 Y: t
- print "Unloading: ", freeLibrary(j);; g; `! I s$ _5 U" e$ U
- end;+ } n+ r% A' I M6 J4 H
- end;% _1 b# u* z4 H: X* ?
复制代码 |