- is' U& K/ I7 m4 X( b( ?3 v
- r:real; file:string;
+ h9 t3 H- G9 v/ I! j - do
2 O4 n2 a" b m5 p6 \% J: E - openConsole;) U, \# s7 n5 ?; e
x2 c8 l+ n0 N: l/ I# F- /*9 m; W/ F- B) I" {" |: ]
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
* r& ]6 a: c& o; R9 z - when is64BitApplication then 64 else 32,+ V2 q. n. n3 K. e& b. V% V; B7 a
- "bit.dll");9 {7 E/ j, |3 f" w
- */
& r6 @, f! V% Q2 v - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
6 h5 n- W: g8 ^# [- S - local j := loadLibrary(file);7 T, r* o! g* B& q
% q# w' V8 n' X7 c) ~" ?$ b# P- if j > 0 then
2 n" \2 a! T8 \+ ^/ S; f7 h - print getLoadedLibrary(j)," is loaded.";6 m- V, U: U5 {3 h0 {
9 |' n3 g) W2 K1 N" l- r := callLibrary(j, "calcSin", PI/6);
, |7 j) @9 S1 F0 ^0 [ - promptmessage(to_str("sin(PI/6) = ", r));
. e/ j1 A& }8 a3 H/ I9 i6 y5 i -
0 c: j& ~5 E% d$ R - local str:string;
, q( |" V8 t& \0 H g# g' t. f. x - str := "I'm OK!";: N* A! T# {& p1 ~, l
- str := callLibrary(j,"resetStr",str);2 L3 H0 v3 I' D4 S) E/ X
- promptmessage(str);
9 O/ ]# j0 o/ ^% f' o0 G1 ]9 I -
6 ]: k# m+ }4 Q - callLibrary(j, "listAccess", Tablefile);3 Y3 G+ [6 F3 x! k; @
-
- I& P2 L1 @2 ?+ K$ j ~* [ - print "Unloading: ", freeLibrary(j);& o/ w$ m7 V5 Q
- end;, e( ~! ~; o" t: {9 b
- end;0 t7 A( g' X. U# y
复制代码 |