- is
- J& `9 f$ a. u2 d - r:real; file:string;
# Q0 v: T; E! ] - do
. |; B$ W K) Y3 v% Z( ? - openConsole;6 K0 }; d9 A/ i7 `" |6 `
* k/ {) V. f x7 W( G- /*
3 [# W5 e8 C+ _: `$ z - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
+ P+ U8 p0 v$ D4 W - when is64BitApplication then 64 else 32,1 L! _1 b) g/ U" P+ Y: O
- "bit.dll");& \+ q* A+ s8 r7 g6 D
- */
" |2 i4 l$ v; d) T6 M# n! e - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";1 o: K$ f& t. Y0 i6 Q' w( k @) p
- local j := loadLibrary(file);0 F. }4 J. d4 z4 @: J! Q0 J
- ; V1 f, U1 g" o- c9 k/ j4 \
- if j > 0 then; E+ B! j, f: c: }
- print getLoadedLibrary(j)," is loaded.";
$ U& ~3 K: H7 ?) x* {9 C
4 }+ @, b" R( g9 Q( V- r := callLibrary(j, "calcSin", PI/6);
6 z1 _4 p' }% H( I; { - promptmessage(to_str("sin(PI/6) = ", r));% i6 ]. s7 V% B' T/ d: F9 @* \
- F2 E* p; n* p
- local str:string;2 k% Q6 [ |8 I% Z A8 Z( v
- str := "I'm OK!";( f% l) A/ B- }) L4 o$ P
- str := callLibrary(j,"resetStr",str);
0 j7 E; F, a: m7 _- p) Y9 K - promptmessage(str);
4 p$ d. P; h! l, @) p! C -
$ G; }4 d1 Z% W) v" Y - callLibrary(j, "listAccess", Tablefile);# g0 _0 v# X* d3 Y4 p; S; Z
-
, w# v$ f* X# B - print "Unloading: ", freeLibrary(j);2 b2 t+ H( q3 A) B: q9 f2 C1 U
- end;. E4 h* ` K* j# ]% g' R6 ^3 \
- end;; a! K! e1 M4 T- a* t h; Q# G
复制代码 |