- is
/ s. g2 }2 @) d7 y) v- i - r:real; file:string;
, _- e8 G) z. v. _) } - do
- h# J4 m/ s% l, D8 b - openConsole;
; b) D5 O( n3 ]' o2 `# L: T - 3 D3 `3 M9 l; S$ G! b5 B
- /*4 ^. v+ Z1 `; z; ~! _% Y! ^
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
' r6 z/ g; T5 O9 @ - when is64BitApplication then 64 else 32,! V( b& k% }) M! _' \8 {3 i3 e+ S
- "bit.dll");! n4 c l/ {. i
- */
" K% U7 |7 C7 P1 d - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
+ s4 S% y1 u! p) {. l* `6 ?, B - local j := loadLibrary(file);5 C# B+ c6 K' Q$ X3 b6 o) I
- : ^* k' |/ D- m) `7 J, s
- if j > 0 then: s$ }/ L# [# E% K" g6 o& i C
- print getLoadedLibrary(j)," is loaded.";
% N& T; q% o! m3 e
, x. _; G2 _ G1 l/ k3 f- r := callLibrary(j, "calcSin", PI/6);6 b- H' t! o; Y9 D. \8 x+ c. c$ p
- promptmessage(to_str("sin(PI/6) = ", r));
! s8 t- I& r# A9 {, G -
' T8 h/ o- b. q& ~ - local str:string;: _% c/ u/ c% T$ a* |! J
- str := "I'm OK!";2 K4 \5 n: f p& \6 ~
- str := callLibrary(j,"resetStr",str);' G; [* c) w. `$ B4 n) u n9 W# z
- promptmessage(str);
* a4 V8 ~4 x; J -
8 \% w/ E( B4 t; J - callLibrary(j, "listAccess", Tablefile);, g& d" V$ V+ X$ @7 C( h( h( w$ }- w
-
; h) }) p1 }0 | - print "Unloading: ", freeLibrary(j);
u. f' z, `; K. F# z4 E! _ - end;
# v& i, m% ]8 w# c, S - end;
! z( a( F, g+ c) }- k0 I3 A: J; ~
复制代码 |