- is3 q* A1 q, T9 ^& A
- r:real; file:string;
! ]6 Q+ h) ~" F4 f# M - do
5 J* ` A5 ^, T9 E - openConsole;
6 {' o6 M) L7 a$ d - 2 y. n8 O. k M
- /*
$ O7 T- i' O$ w: P# }. V - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
7 m4 \% _4 Y/ k- T( a- ? - when is64BitApplication then 64 else 32,3 v2 M& |- {7 G" O3 D& N) g
- "bit.dll");
, _5 b; h6 u6 a0 v: E. h1 c# F) n - */
( t$ q/ R: N9 I1 K* T! O - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";; p! x1 s5 g2 [) I( n4 o
- local j := loadLibrary(file);5 _2 B( p/ r, B+ r7 k: N6 p9 \
- ' c9 D/ s+ h) o2 [
- if j > 0 then
) P4 H( G4 D6 }, o) p" t1 ` - print getLoadedLibrary(j)," is loaded.";
4 }+ S' Y% b, i4 Z5 Q - , Z+ q8 M, _; d' @3 U6 [
- r := callLibrary(j, "calcSin", PI/6);5 o$ g1 a4 j0 P4 A8 N+ Q- C2 }
- promptmessage(to_str("sin(PI/6) = ", r));
. K! v( {# R7 E8 v7 G& y -
6 j# o$ ]2 H! J# I# { - local str:string;2 P: } u+ M6 e8 }8 h
- str := "I'm OK!";
! s, O& l, x7 Z T - str := callLibrary(j,"resetStr",str);% l; y* u9 A: c% p/ K7 x, S; T
- promptmessage(str);8 E* f3 h" W& K
-
& S" K. Y7 Y/ h0 t7 d7 \ c$ j( C - callLibrary(j, "listAccess", Tablefile);
. E3 f8 v/ U. ?; \3 S" S( O -
) R5 e+ R$ W) Y" \ n, m2 | - print "Unloading: ", freeLibrary(j);
; I- d4 \" z! B( C6 Z - end;
% ]% k- ^9 f v - end;3 W7 Z* p4 J' w: G. \" G5 r
复制代码 |