- is
7 u6 o0 J" [$ S& g - r:real; file:string;+ I$ Y3 J! }* u& [4 J
- do
7 j! M9 m7 G8 j) t - openConsole;4 u" Q8 A1 t( H# E- ]
4 i9 X, D: B" [! `- t; y- /*0 F! l: ~/ v+ h b
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf"," D% [/ j. ~/ e; [" U0 Y5 H
- when is64BitApplication then 64 else 32,, f4 z0 Q! v; _6 U# v: O
- "bit.dll");
/ F: h: c/ Y1 P4 Y6 Y2 K - */
# V; d$ }; d) S: m( E: @/ j - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
# S! `3 Y( }9 ~7 j7 y2 p5 f - local j := loadLibrary(file);4 h) U( U9 t/ P( B
- : R1 h% i4 t7 x7 e/ X. n$ |
- if j > 0 then% E' ]* Q3 Q4 Y* T; M( ~ c
- print getLoadedLibrary(j)," is loaded.";; k( C7 j8 x$ [1 {2 s8 g0 B; U9 I
- " H3 h* V+ g, r& D
- r := callLibrary(j, "calcSin", PI/6);
% x! e2 O" P) g. { V - promptmessage(to_str("sin(PI/6) = ", r));) \# b. A6 E2 \3 L/ [+ H# F, F* s
- ' u' ^( _. ?" v5 d: a
- local str:string;0 L" \% z5 l& a( D. d1 C! L
- str := "I'm OK!";. b5 }8 R7 e' W7 }3 a, W
- str := callLibrary(j,"resetStr",str);
* T( b6 A/ [# S) W0 H2 z: M$ C - promptmessage(str);' M: _; s$ z6 X( j$ `
- + C/ s: @# d& I$ M4 W- [. c
- callLibrary(j, "listAccess", Tablefile);
. D% t& U$ {7 y0 v& ` - ; W6 [2 R7 M4 s
- print "Unloading: ", freeLibrary(j);
( I8 s1 m( [0 G, t - end;
! d# W c# Q8 j" {" C& r8 u - end;& I; D" u# y9 |% \6 M v
复制代码 |