- is
) U9 C2 c. w; ^ - r:real; file:string;
! v3 ~8 z- J9 |, L - do
$ v! ~) p, {" L1 s6 G {$ c - openConsole;
& W" r3 g% Z2 v# J( }
3 P6 V! [& e" l6 E- /*
: L* \2 \2 X% K. P - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
" V7 G3 N7 ~: D - when is64BitApplication then 64 else 32,
& D+ R% a1 B- o" _. m* { - "bit.dll");
' e5 G" g3 N1 s5 v - */
o7 E2 c0 {5 x - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
% Y8 _3 ?2 c6 h - local j := loadLibrary(file);$ K# W1 G' o- y6 b: F0 y* _7 W
- 3 G6 n1 i8 o/ s
- if j > 0 then& ?% j! A( F" k2 m
- print getLoadedLibrary(j)," is loaded.";
3 V( R# Z( N* G" ^ O; g
4 G$ {) ~, S) B9 a) [* i1 h- r := callLibrary(j, "calcSin", PI/6);# y: |( A6 v( h" z$ h
- promptmessage(to_str("sin(PI/6) = ", r));
7 O! n( Q& q% Y. t1 O8 o - + C/ a9 m u4 T; s6 ~. T
- local str:string;/ m1 h% ]/ Q6 l/ Q5 H
- str := "I'm OK!";
& S: ~# g6 U2 h& B0 @: h: [ - str := callLibrary(j,"resetStr",str);# }4 S2 S6 _: l
- promptmessage(str);$ ~4 X5 N: Q# t8 |5 T7 d5 @
-
8 w. c/ |- K7 \( q: q& N - callLibrary(j, "listAccess", Tablefile);/ T. j5 E( u% L4 ]
- 1 W- [8 E" n( ^( ^
- print "Unloading: ", freeLibrary(j);# b1 P! C! v; G0 g: N7 ?
- end;
# L' b) u% v, @( ^, z - end;- \! U6 \( D8 Z, {
复制代码 |