- is% b5 ~$ `2 ?; m; N* Y
- r:real; file:string;, w; X; @/ h2 W- u2 I" @
- do
0 k& f7 A& H; v8 e - openConsole;
9 H- f8 P2 G9 y5 }/ k5 {
9 }& S' ~; i9 M+ ^& a- /*
h6 P: Y! R; W$ [* [8 T* O" L, O) \" x - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
! F: F7 \7 a' m - when is64BitApplication then 64 else 32,, O, g+ ]1 n6 t# A* E! c n4 {
- "bit.dll");
1 o* e8 b3 x: S4 O; d - */
, j2 u4 j: j( y. d k5 D( t$ D2 ]4 E - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";/ t. S, Y! w7 `7 p' V( Y3 @
- local j := loadLibrary(file);
. F5 n# R# P& {+ p6 y$ Q - . U2 q* m% F) L$ B& X) v* u
- if j > 0 then) K) |% I" H+ M6 n# ^; s
- print getLoadedLibrary(j)," is loaded.";
( X* \3 x, h3 R' s# _+ J- o
4 F4 ~ N2 Y, s# N+ M# u- r := callLibrary(j, "calcSin", PI/6);
' x/ I; c# ~0 T: E - promptmessage(to_str("sin(PI/6) = ", r));
. w. n# ~2 S6 H! f) }' E) ` -
$ Q' ?' r1 t; F' E6 ~. V) } - local str:string;
6 ~8 v ?( z: c8 m4 d - str := "I'm OK!";; O- L! Q8 b% k% j# X
- str := callLibrary(j,"resetStr",str);; U% n! G1 X, o; w5 o) t
- promptmessage(str);! Y! m( |( }# b! X9 i& ?
-
, o: ^9 |: Y4 a* Z - callLibrary(j, "listAccess", Tablefile);" @2 `% t8 W! p: h
-
8 k6 H2 j& Z' R0 _ - print "Unloading: ", freeLibrary(j);
9 ?6 r" z1 W2 _5 r5 } - end;
2 J, v3 V2 d2 V* Y5 g' L - end;) k) b% |4 |% K0 A' x. ~
复制代码 |