- is
* z/ D7 h1 ~6 o) l% N! b7 Q" O$ S- o - r:real; file:string;
: F0 L1 q3 ^6 M% F - do7 ?3 N- F/ q: z9 C3 W- K3 |2 a
- openConsole;
1 [ Y7 ]. H% o - $ R% t# c. b" A$ F
- /*
* Z; G, i1 U! c1 O - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
) ?& s3 j8 D+ B4 L3 m0 J - when is64BitApplication then 64 else 32,
; s: a- z1 e9 {3 b1 c - "bit.dll");/ X7 T( x) a8 Z Y, Y
- */1 ~% q1 K5 q+ o# Q/ e4 l
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";$ I& F" [; k" M
- local j := loadLibrary(file);6 t1 o: `& Q! F' ~) E1 l. M
- & o: K, m7 M4 @. u) s' H
- if j > 0 then: n/ z- H) W9 o5 e
- print getLoadedLibrary(j)," is loaded.";" b+ C' j3 |8 z: y, S
8 l: `% H& [" _) n- r := callLibrary(j, "calcSin", PI/6);
?0 z/ y1 x/ a4 c% D' L2 F) { - promptmessage(to_str("sin(PI/6) = ", r));
/ t6 {3 C3 O; {2 U; p8 c: Y9 z# b/ ^ -
0 u* E5 A' D6 H' A - local str:string;
% H, }9 V+ c( U" L: `2 S( H4 C' \ - str := "I'm OK!";
8 D0 ~5 s- |- [% q - str := callLibrary(j,"resetStr",str);4 y, f+ F; D& d- h' W! I3 r) `+ S
- promptmessage(str);# o! [; n* q9 y: J3 K+ o0 [
- , T+ C3 d; K) \! B# ]4 W
- callLibrary(j, "listAccess", Tablefile);
( L4 f/ Z p& r1 h -
. J" Z4 @9 c" S2 b& q% M% ~, f/ N - print "Unloading: ", freeLibrary(j);( B+ I# P" G* d1 Y, ~
- end;
& n& G* o8 e5 x - end;
7 m( E3 b' ]. Y, X: \
复制代码 |