- is
" z2 K2 _8 c P2 B1 _ - r:real; file:string;# o$ [, v( b9 z
- do: b* O9 k. t% g% I& W
- openConsole;; K; I# F, F+ B6 K' ~
. A/ k" m( {1 s$ q- /*" F# s) z4 y* K
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
- A1 C; k; G1 ]) o& D+ d. r' b - when is64BitApplication then 64 else 32,
2 S. L" L% h" E/ @ - "bit.dll");2 b, \" Y: s7 p: s
- */1 ]5 B% @ \* s" P2 G
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";6 e% `0 S; @8 k* i& D
- local j := loadLibrary(file);
! e8 R, s1 P7 ?# V5 `! R - 2 ]$ d4 g& s+ j: Y
- if j > 0 then% w. R& a5 L; y; W9 T) M
- print getLoadedLibrary(j)," is loaded.";: J2 _; u! u" `8 P* r3 Q7 U/ e
- . F& f/ S/ L( P5 |7 k; S
- r := callLibrary(j, "calcSin", PI/6);0 O% P- L2 w- ~1 v+ f: V8 [
- promptmessage(to_str("sin(PI/6) = ", r));; e2 u) R; [' N5 u [' h0 Y
-
! t |; E/ \- S7 ] - local str:string;5 k& }1 E8 i7 @# {6 N0 l$ c
- str := "I'm OK!";' m7 M+ m k, Q, a! O- |
- str := callLibrary(j,"resetStr",str);
" O. ?8 r5 a [1 r - promptmessage(str);
2 N+ m6 U* t( M: k/ l4 j" ~ -
) K$ S$ m r: ~8 P8 _ - callLibrary(j, "listAccess", Tablefile);1 W$ s, y; R+ ?4 j
- 1 ?0 T4 i d( p* d. Q. k: x
- print "Unloading: ", freeLibrary(j);
1 ^! Z4 L/ u% L1 E9 A - end;2 ^6 H0 M2 ?* {
- end;/ Y/ e- P+ G6 G( l% c& M _# g7 Z
复制代码 |