- is
: E1 A0 I1 S$ q9 \. A, j e- c - r:real; file:string; W5 h) a% j' s1 D4 V
- do
/ Y2 U) s/ x5 w - openConsole;1 L }. Y7 m3 x3 [+ ]
1 R# ^# G. q- P. ?5 d; e- r, Q0 C- /*. n2 R# m# P0 H! i* R
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",! j' L) Q" J% O8 f' q7 Q7 T& G# ?
- when is64BitApplication then 64 else 32,$ K" N" e! q* Z5 C7 [
- "bit.dll");
1 Y9 ]; m% l- U+ O - */, ^ s Q$ o% j
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
& a* X" V, b9 G8 \5 Q d - local j := loadLibrary(file);- |# F2 ^$ h! L( q" O1 a
0 W8 I, [* ~3 T* b- if j > 0 then7 \6 O$ ~( i& t4 X% T6 f* L
- print getLoadedLibrary(j)," is loaded.";
$ [' f& m" `: q2 L: N7 J - ( ?% g$ f6 {6 g7 l4 {
- r := callLibrary(j, "calcSin", PI/6);5 h' F& k- C7 a, }+ a
- promptmessage(to_str("sin(PI/6) = ", r));0 M# X+ F w8 s8 w8 W5 |
-
& N% H+ O8 E, a3 D4 I. z - local str:string;( h$ b) q1 O# j* T
- str := "I'm OK!";) f) k) Q) n, ?, e4 w {$ F1 e% L
- str := callLibrary(j,"resetStr",str);+ I7 @( ~$ x- y0 n2 Y* @
- promptmessage(str); ~8 T1 Z0 F v0 N, F* M# y
-
; u# Z$ Q* d2 m3 U8 b5 W - callLibrary(j, "listAccess", Tablefile);
4 a1 V9 N1 O. f) V! P9 L - 6 D5 x5 a2 R6 u0 J7 f
- print "Unloading: ", freeLibrary(j);
- v% h/ ^" z" N0 Z9 B& Y$ h8 { - end;& k+ L' Y+ ^3 o$ U3 L/ @. J# o; c
- end;- r: v8 e' l9 X6 U* U7 d
复制代码 |