- is/ a D! p+ d5 K) p' b
- r:real; file:string;
6 @) y; U7 K6 _) O/ a& k9 C - do' v. g0 e6 W/ G! z1 m4 P: |
- openConsole;
1 K) z8 J( }0 [- X+ u5 C. F ` - ! e* ]- Z4 s% @, X6 s$ I0 b
- /*! g9 L4 k- ~- o7 {/ M
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
; {, Q7 j# c3 ~ - when is64BitApplication then 64 else 32,+ Y# ?, J# P/ ?
- "bit.dll");
+ c* Q0 U2 {4 l2 |! Q, {" D - */
$ G+ L( p6 U, Z6 b3 t* W - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";% `4 h1 g5 z! \! I+ l! g) S
- local j := loadLibrary(file);
8 ?) @! o& b& n! t7 q0 N3 s
- Y/ N8 ^- s% i& t- if j > 0 then; A# q/ U5 `$ E* Z1 j* n8 k$ q3 H7 z
- print getLoadedLibrary(j)," is loaded.";0 Q. G# _% H; S( n9 U1 w
9 K: J3 {# |5 f. V- r := callLibrary(j, "calcSin", PI/6);7 T* T: W/ @8 t9 B" j1 R, f; u
- promptmessage(to_str("sin(PI/6) = ", r));8 y, U4 R5 H2 r) g7 n
- & F+ Z8 Q# X; }9 c
- local str:string;) K+ g7 O! W- Q! w2 j5 s4 x
- str := "I'm OK!";0 V9 ~. e/ f) o! \3 R% I6 |
- str := callLibrary(j,"resetStr",str);; N8 V8 V4 w- Q0 s
- promptmessage(str);
% u* w* G& g( s) ]& {0 t -
5 A: d; d" j6 m- Q+ f - callLibrary(j, "listAccess", Tablefile);/ Q) q) v( H; \) Q4 Q
-
8 a% l) W5 J2 l4 s; i0 U - print "Unloading: ", freeLibrary(j);% F/ j9 ?# p! E. v: |, U, m
- end;. |9 W4 k. ]4 w- ~- D/ h
- end;( G# g4 M% U, E y0 r8 q) q
复制代码 |