- is
8 W s1 A7 H! H* u - r:real; file:string;" t; z5 L2 p; A5 g" Q' l
- do, Q6 a& f- n9 _" T6 ^- D% L
- openConsole;
" H! T8 W* n, U* V9 [; f
" }# C. {' d1 ~- [0 x7 I8 K- /*
4 f& I7 Z* Z" D( A( H( I" Q5 \ - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",5 o, m+ B+ b- ]8 D* z
- when is64BitApplication then 64 else 32,; {+ l# r0 ~6 ~1 i- U4 x1 p
- "bit.dll");
! J8 X) @- J( x# O5 W - */
. W# k K6 g% m1 W% c0 O+ H Z( A+ A - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";4 U! J. L$ i# V) y
- local j := loadLibrary(file);
8 O5 X8 X' G$ g. m$ ^0 G - , s/ v7 ~" U C
- if j > 0 then6 k z! P6 _3 n5 O1 l9 r
- print getLoadedLibrary(j)," is loaded.";
* v+ k% ]. M/ \7 z1 Z0 ] - & S7 x. g- S1 e4 V2 x# p* o
- r := callLibrary(j, "calcSin", PI/6);
* `, u3 k" B( A - promptmessage(to_str("sin(PI/6) = ", r));
/ _% {1 a, b3 q) p0 f0 s( f - / @* J; h) @1 `& N) \% u( c% k
- local str:string;2 X% Z+ ?8 x0 J& N$ f4 s( K
- str := "I'm OK!";
5 f# x5 {" c7 o2 o) e - str := callLibrary(j,"resetStr",str);! L! C' N+ x2 u% Q$ G( S3 o( n- e
- promptmessage(str);; ` s$ h+ w* L
- * d$ J* ~' r8 c, b( Y
- callLibrary(j, "listAccess", Tablefile);' X9 G3 `/ M! Q% E0 c0 R
-
! S8 B1 K; |# _1 O7 N* k6 { - print "Unloading: ", freeLibrary(j);
* y q8 @6 j, R3 g% Y8 F - end;
" U, {1 ~8 Q5 |1 |. B - end;
# C6 `' G* y$ ^) i! R4 E& c
复制代码 |