- is0 q: ~3 w; i7 ^) M& \
- r:real; file:string;& e9 R* A \ B, [
- do
' y6 Q; X3 N1 |% _- }( }+ `; c& p - openConsole;
7 y, X9 o: u9 C% Q6 \ - 3 e4 |* `& z' C: m7 }, o
- /*% v; l* U* \* C U
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
! K( S N/ S2 {) D. b+ _$ | - when is64BitApplication then 64 else 32,( Y/ P4 ]/ X5 C: b# Q
- "bit.dll");: o* U7 K) K& V9 q* L
- */0 G, W. M7 r& D0 y
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
) p4 ^/ E. M2 @3 Z& r9 \ - local j := loadLibrary(file);: v) c' @$ I7 F- `+ m
- % x$ k" C. n0 z, y
- if j > 0 then
0 ^6 B, ^$ x7 S3 M! a" l# S - print getLoadedLibrary(j)," is loaded.";- A' {2 y- g6 g
" e4 [+ K2 x* w0 i3 ^- r := callLibrary(j, "calcSin", PI/6);
; o G4 b9 C' ~! z3 z% _ - promptmessage(to_str("sin(PI/6) = ", r));
/ i0 m: V8 Q8 j# C, r* @ -
/ s H& s6 Q1 n: ]0 Z9 [( y1 e9 b - local str:string;2 W: O+ s+ b7 r, F1 H* p- h4 r
- str := "I'm OK!";
6 ]' V m: ^9 ^& L9 ] - str := callLibrary(j,"resetStr",str);
' E( e( O7 _1 L! r c% o - promptmessage(str);
- X1 m! Q& G9 E& f4 y: | -
+ q! b+ K, X! @" c/ H& U9 O - callLibrary(j, "listAccess", Tablefile);
2 t- V# y) H5 J. o% f! ] -
7 N, |4 W9 H" ~ |# L, l$ f - print "Unloading: ", freeLibrary(j);
) K. T& A e3 E) o$ _1 _ P6 D - end;
2 p3 k* t' Q0 B: m - end;
4 z! l2 _7 Q$ r0 Z* z
复制代码 |