- is
. ?" q: T/ P( s( I# q - r:real; file:string;
/ c3 G6 Q7 P4 N6 T H - do; j+ O4 V: Q* s, _ D& g" `' d4 E7 n
- openConsole;: D+ d* k. B8 R$ t, _2 x% b3 U* {
- & G) U" a4 a( M5 ~% G
- /*
# a2 w* J8 O+ `, Y3 \ - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",: U; O# F. q) f& r' \. _
- when is64BitApplication then 64 else 32,) r W/ H# c( n' M
- "bit.dll");
( X! J* k( t" T8 ~7 U! O; | - */
" o4 l4 }/ S C' } - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";) o% r U/ b) K4 r- l9 F- G
- local j := loadLibrary(file);
9 `, `( O* [9 E% |/ V
+ S, Z1 N8 p, ]% }) \5 L- if j > 0 then
% c9 c+ f y0 y4 d$ j0 z - print getLoadedLibrary(j)," is loaded.";
- S. U, J) B! a7 S8 Q$ M
" J+ H5 Z+ y" X- ]: c6 @8 q- r := callLibrary(j, "calcSin", PI/6);1 H, f' ~2 b, [+ e% m3 Z
- promptmessage(to_str("sin(PI/6) = ", r));" l' q/ _6 V* w" W
- $ ]; u! o f- x+ y0 r8 a8 u* g- m" B6 s
- local str:string;% {) G4 I+ A2 O2 |! O2 [' l' U8 F" [
- str := "I'm OK!";
5 C2 |% z( ^- w - str := callLibrary(j,"resetStr",str);
6 S( i! E! ]' I+ {" h- C3 i: \& a7 j - promptmessage(str);* `- ]% I0 c8 ]2 y
- ; p; w. G {$ w- O* x
- callLibrary(j, "listAccess", Tablefile);
8 G5 U+ c) l! j' J$ w1 K - * R( d# X$ d& j8 i, A# k: Y- J
- print "Unloading: ", freeLibrary(j);" S! c0 @! C; b# a
- end;
9 ], p" Q. }$ T! E& F- u2 z/ y - end;
/ r# ^ N* X$ y6 t. J
复制代码 |