- is
8 m" l3 z+ f6 Z7 r - r:real; file:string;
# k- C1 c3 I8 b4 y+ o- l8 @/ u - do* W d) ~2 A, n& X' F
- openConsole;5 ~& ~& k. v/ W; v
- 4 Y Y2 t6 Y. y, i
- /*$ S& w% {) b \
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
+ Z* o0 J( `6 Z1 h; I* p - when is64BitApplication then 64 else 32,
+ N6 e/ T8 C1 F7 q- z4 C - "bit.dll"); v1 |( ]2 ]. X
- */
4 e4 U: p6 F7 @' [ - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
0 r/ O/ B# C$ s! N2 u - local j := loadLibrary(file);$ d, J( l' v+ t4 j, I) Z
6 P7 s* x4 d* V7 E ~4 s- if j > 0 then @" e1 O4 @: _6 m
- print getLoadedLibrary(j)," is loaded.";
! F- K$ t6 R- k @
* }# i, ^, s6 l4 @ ^1 e* j- r := callLibrary(j, "calcSin", PI/6);
7 l* Y3 z5 B! s, n4 V* [& n - promptmessage(to_str("sin(PI/6) = ", r));
4 j9 D) J2 c8 ]0 B2 T2 U - ' R, G& h+ `* _: Z8 z
- local str:string;
" L3 ]" ]$ _- G: c7 s7 D5 o0 \6 { - str := "I'm OK!";9 M8 p% u. O& b* E$ K
- str := callLibrary(j,"resetStr",str);
1 T3 o- M9 O! \5 x - promptmessage(str);( f) _) l7 v" }
-
, W, c: ]9 r* b3 b3 C1 q9 S* D - callLibrary(j, "listAccess", Tablefile);
4 \4 q) `0 I3 [, t7 S1 E- f) H5 c -
1 T" _+ Y6 |9 ~. \0 ^ - print "Unloading: ", freeLibrary(j);
1 M4 [. i& N+ p' U - end; `$ l$ Y8 C7 M- r3 O1 R+ c
- end;
9 f o" `: {. q+ a! r8 Y5 M% l
复制代码 |