- is/ V y0 ^9 F! i. h/ D) x' Z
- r:real; file:string;! _# O! H- d, u* I* D
- do% R' [& F4 ?9 C$ w
- openConsole;
0 g; \: t n6 o; s& u5 [ - 8 N( V8 w1 s2 Z; [
- /*
7 B/ f+ M0 j. V- U8 _ - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
^* i: G- Z. M3 Z - when is64BitApplication then 64 else 32,
! a0 n# Q3 R- j5 @2 b U" q A - "bit.dll");
3 S. Q1 ^' a3 U+ m1 T* X - */
* }# H* m& S& }) O - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
. ^+ b1 y* b2 A/ q0 i1 I - local j := loadLibrary(file);* H! T" J. [ p6 p6 v( U" u
7 P% H9 |6 D I N+ w5 k- if j > 0 then
- A2 y: G6 m8 y2 r4 n - print getLoadedLibrary(j)," is loaded.";
. m7 N, n& ~& T5 W0 L# t9 [ - 3 A8 Q8 K# A9 K
- r := callLibrary(j, "calcSin", PI/6); {8 c0 \+ c0 a2 J
- promptmessage(to_str("sin(PI/6) = ", r));
# k6 i+ T8 `( t0 g2 F0 f - , c5 X+ B' U8 B1 Y& z
- local str:string;# [! i# L5 U$ n2 t8 s
- str := "I'm OK!";
2 c4 D0 h5 G) b7 M' S - str := callLibrary(j,"resetStr",str);
^2 Y o3 Z A - promptmessage(str);* H( q. D' n. p) q; d2 t
-
9 ^! l' [4 y! H - callLibrary(j, "listAccess", Tablefile);" a* ~* ?$ p d8 F9 W# E
- % X& l+ Y8 F, L5 W J
- print "Unloading: ", freeLibrary(j);
- @+ g: |9 ~% s - end;
6 r- [1 P: m! Q - end;7 K4 W s! {+ s" b7 q* ?+ o
复制代码 |