- is
9 @* V6 t& J2 U( g8 ?$ h, L) S - r:real; file:string;
5 ^6 g+ n! Q! x1 U: {# P; n" S - do: f6 x' d2 L# {: k! m0 D& V
- openConsole;, \: L0 r8 a8 z6 p
& t, Z" z9 h4 G0 Q! }- /*. ?7 n: _. A- e& S9 Z$ h
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",0 n7 K8 Z& g+ d8 |
- when is64BitApplication then 64 else 32,
R1 K* y* g- ^/ x - "bit.dll");( n% W: F0 I" a% f; {# v% w
- */
6 u. B: j$ e5 E. S% y9 @ f/ m; F - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";6 b3 k7 w7 M6 Z
- local j := loadLibrary(file);5 ^7 u' F& x% ~$ v- M4 n
: E1 g) f8 F, U- if j > 0 then7 q$ n$ V( z# {( j* Q$ I
- print getLoadedLibrary(j)," is loaded.";0 ~# F( S8 s% J; V1 h3 U; G
2 g( G9 v# \! W- r := callLibrary(j, "calcSin", PI/6);0 v3 g3 X7 |; `) ]
- promptmessage(to_str("sin(PI/6) = ", r));) x* ~% `9 k* p$ |# o
-
! c* r: y; R% ?5 l7 P - local str:string;
: S# S9 |; p; t) t. F | - str := "I'm OK!";$ |. t5 A6 `5 R! j
- str := callLibrary(j,"resetStr",str);
5 f1 l2 Q3 @ z. @9 {2 n7 N - promptmessage(str);. o1 `5 E, }% a0 C* c
-
3 B+ C% L& I4 @7 x/ H - callLibrary(j, "listAccess", Tablefile);
5 f" G4 r# A: [$ I! u3 X L -
6 @( J' B9 `. l& y - print "Unloading: ", freeLibrary(j);
/ T k/ S4 r" ]. `6 j - end;
4 r9 F2 b2 y4 \3 ~! e8 L6 y - end;
% X2 @. E+ s: I/ j" j8 i( ~2 w
复制代码 |