- is
7 V I& C2 N0 V `: b( o - r:real; file:string;
+ V4 |& P& S! b* R - do
3 K1 ~% G/ O4 }. Y+ O( l% u! A: G - openConsole;# D1 ^( H3 N0 \
- - H9 t4 h S( a0 Y
- /*5 i7 T7 G, e9 P/ P3 k( w
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",9 z1 V$ _4 N7 A3 n6 H
- when is64BitApplication then 64 else 32,6 F; A5 P9 p+ d: P: d/ }
- "bit.dll");
5 w5 b. [2 |5 n$ v8 s9 }9 | - */
) D: G3 k+ V' c! K+ T$ R" G - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";# k1 G/ }+ E# P
- local j := loadLibrary(file);
# n' u; |( _) t3 i. Z$ P - , V& O1 s0 Q3 v/ T
- if j > 0 then- ?' k+ @$ h" m5 s
- print getLoadedLibrary(j)," is loaded.";
$ e+ O' m9 G( B( b+ @
# ` h* w" p6 f+ h: C0 q$ f/ i% Z- r := callLibrary(j, "calcSin", PI/6);! ]9 a2 l* x/ B' n3 H: r
- promptmessage(to_str("sin(PI/6) = ", r));4 K% t) F6 {8 H5 B3 N( [
- : k: Z8 y! Y) [2 q7 A# E9 W
- local str:string;2 E. l; Q# ]6 A- x- S( }
- str := "I'm OK!";- Y9 X9 _$ ~8 y8 g: n4 L
- str := callLibrary(j,"resetStr",str);
0 U' i8 a! j( ]; h& m _ - promptmessage(str);+ V$ v o9 ?8 w2 f
- % ?( ~( _ x! C$ y- }
- callLibrary(j, "listAccess", Tablefile);
6 Q$ n+ \" a$ P$ B5 w -
/ d# @# v% G; y! s - print "Unloading: ", freeLibrary(j);
/ W4 Y( I/ S d1 A* B6 j) h8 O - end;
8 Z. T" b# Y2 v, ?& e/ D/ q - end;
3 W+ O. ^0 e, B7 `( F1 ^0 y
复制代码 |