- is) c! B6 n9 [& P, [- F, @
- r:real; file:string;
5 }- n! G5 u1 l! u. d9 v - do, D# U( P/ I8 N9 ?/ Z0 L
- openConsole;0 J% Z0 L/ A# i
- & i1 V* d z% p1 {9 }
- /*
- B$ X: X4 R9 w+ W, [9 f8 v - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
; A% |! i6 h% V% w% { - when is64BitApplication then 64 else 32,
1 M: f r3 N, V h - "bit.dll");+ k1 I# s2 ^/ V4 C
- */
1 H7 Z8 \/ }0 b4 }& o) z - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
$ U9 j+ _# N* L/ g# Q9 @7 { - local j := loadLibrary(file);$ q* X: ?- w T% O ]3 H
, s: c1 v8 r4 L) V* ~- if j > 0 then
- a \0 e4 {5 l2 V0 i5 r+ K - print getLoadedLibrary(j)," is loaded.";
. D9 Z" M: t+ C; H* \
# ~3 _4 u; H3 w+ @; `4 T- r := callLibrary(j, "calcSin", PI/6);
, p1 {5 q2 ?/ d, ?9 V - promptmessage(to_str("sin(PI/6) = ", r));
C- A0 k' l+ k% B+ r- R: n# n& [) a - 6 u' {- a7 J$ a8 ?" C) t: d
- local str:string;# D: [" b4 b- }7 f
- str := "I'm OK!";! | _+ ^$ B8 G7 N* z4 E4 h
- str := callLibrary(j,"resetStr",str);1 D$ i8 u+ Q6 W6 h5 H& r+ Q
- promptmessage(str);
$ O$ M- m. U |: ] - 9 w/ o! E* d6 d# w M/ _
- callLibrary(j, "listAccess", Tablefile);( [# E0 W; y, H8 z6 D/ a
- 0 J4 P; d) {, j; f- K
- print "Unloading: ", freeLibrary(j);* w. F0 O; t' P9 E8 q/ E1 u* r
- end;" m( k% m, @ @9 ?! g' T" ]
- end;7 k y: `) t# i) A, C
复制代码 |