- is
/ c* M5 G) r* o7 c* b6 d - r:real; file:string;
5 O$ d+ |/ V( `, F( B- e - do! i% d$ n* a9 q$ \' i5 v. U+ F
- openConsole;8 e. I1 ~6 g( X! ^4 S' E( v( |4 @
- 9 K' M; n- J! X1 Z) u+ C6 t
- /*
3 f: U8 h( M* \1 l0 u, H' N - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
4 U& }9 k8 ?$ e% k/ _ - when is64BitApplication then 64 else 32,% a; m @* f8 ~7 t6 r5 C/ D
- "bit.dll");+ R+ |' k/ T0 |1 a
- */' s, h& K( q: S
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";' U* P/ q5 I, S0 s7 x
- local j := loadLibrary(file);
0 Y5 C- d% \" I
% F, q. C/ K* G8 g- if j > 0 then+ w3 h/ j7 l# t, j4 H2 @ p
- print getLoadedLibrary(j)," is loaded.";
# {. T# b# ^. b. o8 Z; t8 T; c - ) c! _5 Z# Q0 a$ b. I9 _3 z
- r := callLibrary(j, "calcSin", PI/6);
3 j" b' s2 w4 y4 L - promptmessage(to_str("sin(PI/6) = ", r));
* c: f# ?% e" s" ^0 P - 1 V$ e- j/ s7 V3 K4 m
- local str:string;7 l" h: |' _9 ?9 g3 |* c* z
- str := "I'm OK!";: K6 b9 r. D% g0 m$ R
- str := callLibrary(j,"resetStr",str);
6 k5 ^7 q* G" p" O. S& @* g4 ^ - promptmessage(str);# g7 E$ l6 m: K
-
( H+ B6 T5 y F6 t4 ] - callLibrary(j, "listAccess", Tablefile);% U8 N5 I: Y$ {% M: Y
-
: x% t Z+ n3 X9 f: A/ f - print "Unloading: ", freeLibrary(j);, t) v2 F5 V# @
- end;
2 U2 T+ m' w, M3 a - end;
3 s: y# p4 X h' r1 Q4 Z
复制代码 |