- is E7 U, |6 r0 K! K! w+ ?. a! P) [
- r:real; file:string;
3 e' a$ h! X3 O1 N1 ^/ j - do
$ t4 A. X- c9 J7 v& k - openConsole;
4 d# ~/ K7 u% P8 _1 G" r
8 q" z B7 E- {2 {8 D- /*
9 _. h0 o( f8 i4 }" o8 q9 b - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
. L, W' X: P R7 j - when is64BitApplication then 64 else 32,
' r; z5 Q5 y" L& Y) a - "bit.dll");3 W$ K# p y( Q. x
- */ s; ~! O8 _" G9 T
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
( l' x- t8 U8 g+ Z8 ]1 b6 C - local j := loadLibrary(file);) A f, m: X# g# n4 s& S% F9 e
B% S4 s0 W0 ]2 O6 ^. g- if j > 0 then
, J: f- [ W2 g5 P T+ ~ - print getLoadedLibrary(j)," is loaded.";- [; b2 J2 s# O' h
- 3 ?1 o' V5 m4 @8 g9 l
- r := callLibrary(j, "calcSin", PI/6);
! O+ C9 i* }1 A% U$ C5 k - promptmessage(to_str("sin(PI/6) = ", r));" y8 O5 Y/ z$ ?* t& F8 C
- 2 k; R% R. S* J8 D# {# y+ r) r- I# B6 Y
- local str:string;4 [5 ]; h* Q2 v, V e
- str := "I'm OK!";
' `2 P5 `" j5 `! ? - str := callLibrary(j,"resetStr",str);
( l. h' r9 q6 \9 i$ W - promptmessage(str);2 V: _4 p# T9 M$ U8 o% V, |
-
; n7 K5 z. T) m. @/ O; V- f8 } - callLibrary(j, "listAccess", Tablefile);/ G, d! d0 o, H9 n
- 1 r6 z$ ~& i0 M3 r/ p
- print "Unloading: ", freeLibrary(j);
9 W; j0 v7 O& c. t/ K+ t5 }+ T - end;3 C1 X' u$ ~9 k4 P; V$ _
- end;: V# N% ^. X8 O/ }3 E% G& ?
复制代码 |