- is
! [! D- S% P# P, ~9 w( y) K - r:real; file:string;
/ Y9 `9 Y& v, ~+ }6 x - do5 ~! k! {" X/ H& @, C ?9 @
- openConsole;) b% c, R! s& w' L' v6 X: C: G
- * ?& z+ o2 D T2 H+ C
- /*$ j* }2 Q- Y" z7 P; U
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",# M, L8 O! G$ c# v
- when is64BitApplication then 64 else 32,+ L# X9 F1 }9 _6 q/ t
- "bit.dll");1 }) s% k1 O( U$ D4 T: `7 P9 D
- */
/ }4 _7 S8 Q3 c4 s- `$ L5 F" P/ v R - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
! P: K# G) W& }8 o- D6 K+ [5 j l - local j := loadLibrary(file);
3 g7 `+ w+ I- V, { - " l% W: P7 S' U0 g! z4 q7 ~' t
- if j > 0 then3 \ y* N& z F0 v; Z" H4 F
- print getLoadedLibrary(j)," is loaded.";
( ~4 b. O8 Y6 A' c - f7 Z" ~9 M4 S* t6 _
- r := callLibrary(j, "calcSin", PI/6);
, H" V. W% W9 w) k9 |) H8 P3 X - promptmessage(to_str("sin(PI/6) = ", r));: k/ @1 G" A/ O" {1 N- k; q! M4 T2 B
-
4 l* ]+ O5 }& u9 ` - local str:string;" F! V( f4 W! j/ b" x$ k& t
- str := "I'm OK!";8 b/ j7 K; r3 p5 s# [
- str := callLibrary(j,"resetStr",str);
; y: v' r' D1 a+ M - promptmessage(str); M2 o# s1 T: N a! `
- , G& K. b& h) N+ {* _( S
- callLibrary(j, "listAccess", Tablefile);7 T( X8 b. Q+ j5 G0 V
- 0 r2 Y& {, O3 T; r
- print "Unloading: ", freeLibrary(j);
6 R- [2 r- T& t - end;6 Y7 R F) V: I
- end;
7 Z m& o5 c& n/ e% Y7 |# e
复制代码 |