- is
3 \2 u; }4 A; Q3 c - r:real; file:string;
. B# N5 W5 `4 P+ s0 C% ~+ F$ R: R - do
; [8 S6 J5 H# m' R* O - openConsole;
" N5 o6 v; c' d) V' r3 W) i" J - 0 c8 s9 a8 @; ~2 R
- /*$ n2 P+ M C" n3 I. w' `
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
7 k( P- V' j% L+ ~$ d$ I! k - when is64BitApplication then 64 else 32,
3 k% l* w/ ^" M( C: O - "bit.dll");$ \# R0 `/ I* P. H" y$ L y7 b
- */
- [2 ^& ] j! q2 u - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
* H0 D, K9 B, x( Z - local j := loadLibrary(file);3 G$ I/ ~3 ~( _/ K* H6 f% i: N0 B. B
9 C' q% t* U! ^, B0 w) Y- if j > 0 then
8 e, Y& M! _7 I# A8 b - print getLoadedLibrary(j)," is loaded.";* I# U8 B$ H! e T2 Y0 x5 `: Y& e
- + v( \: H* d2 [/ M* }
- r := callLibrary(j, "calcSin", PI/6);
( E9 o% @2 r# X0 p - promptmessage(to_str("sin(PI/6) = ", r));
2 h/ I C6 A4 s - ( q5 ^; }: z* `- t- {& g. O/ k
- local str:string;) d/ `% u, Y4 o2 U' ] ^/ t$ s
- str := "I'm OK!";
# a2 `% X( w* I3 n3 w2 d# v - str := callLibrary(j,"resetStr",str);
5 ~( {6 d7 p1 J6 k - promptmessage(str); V, P5 c1 ]1 J! D
-
) S- j% F: O ~0 [" c n& r Y - callLibrary(j, "listAccess", Tablefile);
9 a. }% a" U% {( S. g8 w - ! }9 a; @6 t9 J- h+ y
- print "Unloading: ", freeLibrary(j);
* G/ d9 P0 z7 D [+ U - end;
1 \7 G% [9 f; J3 r$ y* B7 E - end;: u4 G+ W# B2 @+ _* L
复制代码 |