- is
! D. F( _# o6 | S8 m - r:real; file:string;) p0 L/ Z3 |/ f0 N
- do
: x; y( Y: h6 h: k8 F9 G - openConsole;8 c" L' f) u, Y# y7 l9 l
- - Z. ?+ j3 i, \' r( h- O
- /*
, X. q0 a9 S3 O& E, o8 U - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
' k/ p8 q: p3 a - when is64BitApplication then 64 else 32,+ R) X2 r$ Y' a+ {9 D
- "bit.dll");
+ J0 a2 l N, A: \8 A; n& y$ } - */
. V, p4 K) ?) u# a# J# x* C - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";" _" Z6 b: b: |
- local j := loadLibrary(file);6 d* N) S7 Z% v' l
- 8 @0 t/ d/ c [/ \9 A
- if j > 0 then
# P7 P! H8 d! K* r6 I - print getLoadedLibrary(j)," is loaded.";) \3 u6 D1 R/ \; R0 k
- 1 }( ]+ F1 V4 K; Y( \, w) ~
- r := callLibrary(j, "calcSin", PI/6);& P+ O# ?8 l, ~% H4 m# U# S
- promptmessage(to_str("sin(PI/6) = ", r));
2 m, o6 i8 L8 @ -
- O8 P7 ?; |* Y+ q# B - local str:string;# w1 w) ?' c" | x# h) D: N: [
- str := "I'm OK!";
+ o$ c" z1 ?: K" ^& } - str := callLibrary(j,"resetStr",str);- J8 e/ w' V) c, \8 e) ^
- promptmessage(str);
. m2 j+ m0 P9 c' c C0 p/ [ - 1 j2 D) u% x x E! P& g7 a/ i
- callLibrary(j, "listAccess", Tablefile);9 C, n3 c3 i% j8 Q7 X
-
0 | m6 g. Z+ N A2 v4 T3 ^1 s - print "Unloading: ", freeLibrary(j);
! o) N8 S: ~# ~! i3 I' W! x - end;
6 E7 d8 C) }4 }( I- i6 h9 ^0 | - end;8 q/ G+ L7 O& A5 p: x% d
复制代码 |