- is
: j r c1 q2 e: _& s# P - r:real; file:string;4 e* n+ }, ^' Y; i4 T
- do
2 ?$ D, k0 I& R! t% f - openConsole;
! d" @, R* [' a) a i4 D3 Q* g - 6 T+ G2 o P# r. E& C% i4 ~, h
- /*
" ^1 k7 ]) h: ], z/ ` - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",/ F0 h, C5 M7 A2 j+ ~9 V3 O
- when is64BitApplication then 64 else 32,
: A) j" B5 W: n2 _7 f) t# i - "bit.dll");
% _3 m( S1 U& `+ ^/ q, U - */
; t6 \' H: w& I9 T' t. [3 n - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";' i1 h8 ]. I5 X0 }4 g- `0 W
- local j := loadLibrary(file);
/ o) E) g' O2 M+ U5 U - ) H( o% D: O9 k8 p! H0 ], N
- if j > 0 then
5 h2 e* y" C9 L6 R3 {/ [( p" |6 ? - print getLoadedLibrary(j)," is loaded.";
! P& ~5 i* i* W6 I( e5 T! G1 C& k
; t' q& w1 o* I! a/ A( n7 Z! b- r := callLibrary(j, "calcSin", PI/6);
# w6 ^0 x! `* \; z - promptmessage(to_str("sin(PI/6) = ", r));# d: r1 j; _. M9 o7 [" ?3 h& N
- & g* p, _' W2 Y0 c* R3 R9 S& Z
- local str:string;6 N# N! _( _6 e5 O% P3 z
- str := "I'm OK!";8 A D" V9 B/ `! T
- str := callLibrary(j,"resetStr",str);
* k3 J: ]! n- M) C# A' p% C - promptmessage(str);, h2 W/ y2 h3 Q- x2 ?) Q h
-
* `2 f+ N( z; ^. i$ l: C) p! Z - callLibrary(j, "listAccess", Tablefile);
% r2 [9 f3 T' S9 e: j -
. k6 z4 P2 a1 k% f - print "Unloading: ", freeLibrary(j);" `. n u4 I- E0 _2 k
- end;
* e; I$ @- i* d3 t! v z: j7 n& S - end;$ Z$ ?- r3 d$ K& R. M
复制代码 |