- is9 \5 n4 O& b& {2 \
- r:real; file:string;" t& j3 Y9 z; u: v$ f1 c
- do
. O* X3 V6 T0 T4 r, d) E - openConsole;; W# S) @8 f; K* J
- % A# o0 m4 x: \- X1 d ~0 e
- /*
; G5 B- N2 M9 ^# [* \ - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",' w9 j+ N+ k- A1 ~+ s$ Q
- when is64BitApplication then 64 else 32,
8 e" a8 ^. B7 _$ h - "bit.dll");
! {) @% p, Q* f! t - */
" w4 s( K* F7 ^( e! G - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";2 m/ L& ]: B" v& j/ l, ~2 k
- local j := loadLibrary(file);
# |: x5 ]$ y$ _/ x - A7 p7 K# W! c3 h' w3 W
- if j > 0 then
5 y2 C1 o1 t' ?4 h- |; Y& @ - print getLoadedLibrary(j)," is loaded.";! h% O- q7 S9 j$ q
) m- ]' m/ V2 l9 \/ c- r := callLibrary(j, "calcSin", PI/6);
+ A& ?5 J) W" A' w/ L3 o+ ? - promptmessage(to_str("sin(PI/6) = ", r));
/ X4 ]; I: u* g8 l7 Y - 3 R% c5 Y/ ?# q! u5 L, G* \) Y: @5 {! P
- local str:string;3 ], y9 R4 ]# V! j4 Z/ a9 g% Q
- str := "I'm OK!";$ g( L) n3 ] J( [
- str := callLibrary(j,"resetStr",str);
* k: \9 ^: u3 A9 q5 a - promptmessage(str);3 a) L9 y2 J1 c* f
- S2 R0 a# v) ~# ^' Z
- callLibrary(j, "listAccess", Tablefile);
- W& C# N8 a/ |' x - ( E4 }% ~0 x6 {, n5 _
- print "Unloading: ", freeLibrary(j);% G6 V! b5 Z9 M0 _4 E
- end;9 i n4 \; Y: R/ [% \0 Y
- end;; o9 H+ P3 q& f j# c/ H9 {
复制代码 |