- is
* w7 f8 ?+ N4 m: m: t6 U - r:real; file:string;$ `) F7 P. a$ O: L. b T
- do
5 s5 b' x- @, B - openConsole;
$ u/ e9 V, {& f9 `) j - + Z X: p8 G; ]$ m1 |. N9 m
- /*0 r4 Y/ M: W3 S9 n$ V
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf"," b! [0 M$ g$ g" P" M2 h+ t" _- R
- when is64BitApplication then 64 else 32,
9 p0 M& [$ {7 c; } - "bit.dll");) u/ }) v1 [8 H& e t/ R
- */
- N- V# ^. b4 J/ _" Z - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
/ ]/ J( @; Z Y7 Y2 J; W! E( t5 m - local j := loadLibrary(file);
) P4 }3 W6 @+ x" {1 Q - + e- a: ]5 M4 ^: C9 i+ t
- if j > 0 then0 u4 E; f( Y- h' G# Q
- print getLoadedLibrary(j)," is loaded.";; F5 m4 e1 T2 j+ }% F
- 3 \" T5 p9 L" Y1 R
- r := callLibrary(j, "calcSin", PI/6);
5 H, D6 N( H, c+ |$ l P - promptmessage(to_str("sin(PI/6) = ", r));
9 L$ ?& y! k" O" ~$ H5 }/ e# n - 7 Z, L4 D3 \; G F6 B
- local str:string;
" n5 N0 X/ E1 @/ }) Y; y - str := "I'm OK!";
) Z1 s) ^& ?4 H6 O: X8 s - str := callLibrary(j,"resetStr",str);
! P2 @& y# x3 m* E - promptmessage(str);
2 O! d) O& j% t -
: Y" V6 }# n) J0 n$ [ - callLibrary(j, "listAccess", Tablefile);
" C) @* n, Y9 v' @ w) C - ( y0 p4 i$ S6 N7 F. \1 y
- print "Unloading: ", freeLibrary(j);0 E1 ? U- P) h1 D4 A- f
- end;' R% w9 W( o; e5 K! r
- end;% ?+ R, U: z& M: U& G4 Z
复制代码 |