- is7 r+ l' \$ Q7 C1 a0 u+ |
- r:real; file:string;
' @: h8 A! X* R& N* o5 p' z - do/ h3 G* w$ h4 O9 J5 s: c9 F0 G8 D
- openConsole;8 {1 b% O8 U: }1 E1 s8 Y3 N
- # j0 E5 q# W; X& a6 Z, v
- /*8 g) j1 I/ w2 F _8 X7 U y
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
8 A( f2 H2 l$ U - when is64BitApplication then 64 else 32,; a7 T8 b! _# U
- "bit.dll");8 h& @5 _& O& X% m6 Q; q- P
- */
/ B5 B. A/ i5 x: e' W. H - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
7 |4 Q9 k5 ?6 M/ L! t- i - local j := loadLibrary(file);
! F# D d) r E7 H% q( V; m) J - 1 _' m# c3 w+ P* \
- if j > 0 then
3 R% R! v# | J8 z! H: j - print getLoadedLibrary(j)," is loaded.";( F- W1 i, K5 ^0 [0 c- ?: t
" g( I+ ^# e0 L) F( _$ }- r := callLibrary(j, "calcSin", PI/6);! |: X5 P. \ L
- promptmessage(to_str("sin(PI/6) = ", r));9 G* B8 @( w) M2 @
-
* t. G, ?5 l6 I c2 X, R - local str:string;3 l) @) b* C' s% C
- str := "I'm OK!";
/ L# e9 A* E7 `' @9 _# | - str := callLibrary(j,"resetStr",str);
: [! U4 |/ o" m- z/ ?% c - promptmessage(str);+ S5 T3 l. z- K) Q* O; ~' C
-
: H4 R+ `7 _9 ]+ W6 Q1 b - callLibrary(j, "listAccess", Tablefile);
, u, d; Z: g; m6 d - k' }4 J, ~1 G5 W; g& {4 G( y
- print "Unloading: ", freeLibrary(j);
* b9 g g- M( K% Z - end;
0 R! M2 z1 m; f: `) h, f9 l: x/ Q - end;. b; |( f+ `# O" O5 y3 H, F
复制代码 |