- is
& @) x9 @. r6 L9 X9 e8 T - r:real; file:string;
2 c$ f; P1 B! b - do
! r- Z# C7 A# ~ - openConsole;$ ^$ E: J4 O7 c
- 9 r: D# E2 R" N! h; ^! u% M3 M9 \( ]
- /*
/ U/ d+ K- x( Z1 n$ B' N - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",9 z1 ?0 V. J" ?& j @
- when is64BitApplication then 64 else 32,9 {8 N3 l" _# l2 M& y3 n# n& {! O
- "bit.dll");
5 m S% N- @ B. ~( M5 Q* f - */
. R0 y6 E7 ]* Y& M/ H - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
: q* {/ I& L7 [ - local j := loadLibrary(file);
& v, C$ K1 `8 a3 x; f/ V* s4 G - # {6 \4 X% U. ?7 [" I; s2 N
- if j > 0 then
% y: \* C" c8 i H+ E) ] - print getLoadedLibrary(j)," is loaded.";
: k( u# ?' g4 p9 Z% a* S3 y5 L+ x - 4 K& R# Q) s) O& P4 d7 h2 g# F
- r := callLibrary(j, "calcSin", PI/6);
5 I5 I- i- a# n4 g- a& J - promptmessage(to_str("sin(PI/6) = ", r));$ K& W! e5 f: p
- ; p! z# {! }) ]% p1 r) M9 X' n1 B, \
- local str:string;
7 V1 R: b8 N* k! c% b/ s0 H8 D - str := "I'm OK!";9 |) ~1 g) g* o. ~& V' x
- str := callLibrary(j,"resetStr",str);! c6 \+ f u2 I/ n3 W
- promptmessage(str);
( J6 T/ B" u- l* N& y3 {7 \ - ' F5 M- p9 l9 Y% ]
- callLibrary(j, "listAccess", Tablefile);
$ ]) V' @( y" g3 p - 0 k M$ F4 u" V9 l6 `8 Y; H$ d
- print "Unloading: ", freeLibrary(j);, R8 V- l4 ]) X. U, e# s" k
- end;
0 @( r4 |4 p3 Q: M) o - end;5 t f" e5 ?- j% Y; ~1 ^9 h
复制代码 |