- is
. q! ~+ r V0 K* C+ N" z: T9 q - r:real; file:string;6 R1 Z# Z: n" W8 [0 X; ]
- do, ~& P' R0 U/ F3 L* t8 P! G, H/ m
- openConsole;
3 a+ a( ^3 @- E3 \4 f+ L5 A - ) ^5 [* }( P8 z; ?" `8 |
- /*
* W% Q9 i3 i* z - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
- X8 Y$ j. d9 R( G0 F0 B1 M9 @ - when is64BitApplication then 64 else 32,. T* U9 n0 Z2 V% f+ I) z
- "bit.dll");0 J( K a' D0 J& s* [
- */
( g1 g# d4 Z: t( w. l* d - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
5 A1 [5 o0 o3 J: Q - local j := loadLibrary(file);
5 n6 {, [" \9 k1 b6 n7 N - ' y9 [! `/ E( P+ j. `- y0 ~
- if j > 0 then# w, f: R) d/ ~! h7 D
- print getLoadedLibrary(j)," is loaded.";9 q+ c5 s" _+ Q; a. l5 v/ c5 t# V
- 2 O: R1 O! r6 i \8 |( O
- r := callLibrary(j, "calcSin", PI/6);9 A3 X0 B8 i- E; x2 _/ z
- promptmessage(to_str("sin(PI/6) = ", r));1 V- m" @% M" z* a
- & T* ]" F! Z/ ^" c6 z) Y1 P3 z
- local str:string;& T/ I0 v8 M6 h+ N
- str := "I'm OK!";
% g/ b, M5 C' v - str := callLibrary(j,"resetStr",str);
" B& j. |+ G5 c4 n - promptmessage(str);
. v" _; V2 D2 M: O4 d# T -
8 A1 P' J- G- I. U2 J, Z - callLibrary(j, "listAccess", Tablefile);( [1 y) J/ a" G3 f# }
-
$ Q7 @7 n1 P! ] - print "Unloading: ", freeLibrary(j);
( }, R" ?) Z* x0 f - end;
: l9 z3 j+ y, Y$ `9 m - end;
2 c6 {' S8 {$ K7 m( }) I- z7 N
复制代码 |