- is
; ^/ K' g l! n, z$ E( v# U# d# r - r:real; file:string;) b$ t) G! ]0 _% Q
- do0 @: g; F# {- f. ]. Z7 b) _
- openConsole;
* Y/ q) h; l* N2 o - 6 \- \7 k: D4 r. E" `5 p
- /*, H' n7 x% {- N
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",: y" e" w1 M) c: ^- D2 `5 R$ U
- when is64BitApplication then 64 else 32,2 I; U* s; q7 j5 `8 ^3 f
- "bit.dll");0 m' F f1 {2 S( ]4 X& ~* N
- */
7 d; n0 W% s9 P - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";% S" m3 h$ F* F# N1 t5 D: @
- local j := loadLibrary(file);1 {" Z- F. K& ^/ z3 F- _) Z& \
$ H0 Y% E! L4 K% [0 i0 Y, ~- if j > 0 then8 Q* L7 u3 U) J) \
- print getLoadedLibrary(j)," is loaded.";
5 N/ o/ |! ~7 p" r - ( \2 m+ O$ h" p
- r := callLibrary(j, "calcSin", PI/6);5 b( B* d3 t* x2 q
- promptmessage(to_str("sin(PI/6) = ", r));- P& I3 K; \- O6 P |' L
- & ~0 z) U4 J+ i% v
- local str:string;/ {0 n2 C b: i& E+ C5 `
- str := "I'm OK!";0 I [! n) {8 O% R2 W) H, g+ ?0 H
- str := callLibrary(j,"resetStr",str);
) e# j1 U, A) o6 t - promptmessage(str);4 j2 S5 c" }( a9 y0 k
-
. x$ x- K9 S# k5 M - callLibrary(j, "listAccess", Tablefile);
% ]1 T) M j3 j# Z: p: w - 5 B0 \" _8 L! e" h, y1 M
- print "Unloading: ", freeLibrary(j);4 l3 L- i0 x1 k8 U2 {
- end;
6 _# [$ E+ X2 n - end;
* o* V, k/ d5 _' _; Q% { }6 j1 p/ f
复制代码 |