- is
% V" _, a3 C7 P: _7 t - r:real; file:string;
7 v6 b/ }7 D @4 x9 G! P - do
. M. `1 o" j# Y( T - openConsole;$ w! F/ ^ |" y) D( v- ~6 X" S
% n1 x$ V. F7 f6 [9 c' I, Q2 O- /*$ P2 L0 N* v2 z5 h9 ?8 l
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
# z! E, F0 _2 O1 k! i$ c' E - when is64BitApplication then 64 else 32,
) k, \- f0 \5 m R- ^ - "bit.dll");
8 d( ^% P. W5 [. x) P, L% `" _ - */
1 e4 L' O/ u; K/ O! N - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
6 p. ]- K; o1 |- e. t - local j := loadLibrary(file);" G/ a' B3 K5 w m( L! e# C
- l! u* w. l) O2 H: \2 \
- if j > 0 then
- K4 E3 {5 k# X' ~$ y- ? - print getLoadedLibrary(j)," is loaded.";5 }/ t& A1 s1 I( h
- * u3 [+ K. b8 M: r
- r := callLibrary(j, "calcSin", PI/6);( w0 y. |* ?0 Z& b5 k6 k; z6 w
- promptmessage(to_str("sin(PI/6) = ", r));
$ {) l; Q0 ?/ A; l9 Z; j; W - , o$ Y# z* N$ q; V7 @8 }" x
- local str:string;, t; x) K' C6 U1 J9 n% n) a2 M
- str := "I'm OK!";8 |+ i7 g2 w& u
- str := callLibrary(j,"resetStr",str);) {+ u9 C& e% X: d. b# p' r
- promptmessage(str);% M! Y) W1 W, r7 ~% h
-
% G. ^! {1 A) M9 o+ s1 f - callLibrary(j, "listAccess", Tablefile);* a1 A2 p4 m& O$ M/ m
- 0 z" Y8 G/ R5 m4 @
- print "Unloading: ", freeLibrary(j);
- L) e1 C9 e' s - end;
- G$ S! K; g2 Q# b% m6 C - end;6 l+ m3 N2 h. h+ D; N, f4 h# K
复制代码 |