- is& z3 r' t8 }7 B8 n0 t
- r:real; file:string;+ b2 l" v3 k8 o! l3 |9 R
- do
+ T2 a9 `4 F. b: c - openConsole; {" q; [7 ^0 [" b# m- `- Y( M
- & o% X* ^+ G& Q0 j* c& T
- /*# a) f# Y- l" b1 U
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",. x5 k; H) [! ~2 Y; O0 Z/ V9 L
- when is64BitApplication then 64 else 32,
/ o3 W0 w$ e: D7 t3 H8 u1 f! \ - "bit.dll");
% ]" j& X7 M2 R' K8 I3 g, { - */
: ]1 n1 @; S5 m7 ~ - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";3 t1 n" n* A& m7 a: d7 S6 a
- local j := loadLibrary(file);
- z3 L) g! ~6 q6 N
# d& z2 {! c+ \$ T2 C+ v2 I$ t6 n- if j > 0 then
$ e: R0 C$ Y) c& }- e9 H - print getLoadedLibrary(j)," is loaded.";5 E0 }% D% J) A6 M
1 y; u" ]( `( a r' N- D4 _- r := callLibrary(j, "calcSin", PI/6);- E2 f$ j/ d1 a8 n k" F z
- promptmessage(to_str("sin(PI/6) = ", r));
7 I5 h: c [- Z8 N4 B -
1 n) `0 L$ C! }9 E: J) T! H0 Q( Y - local str:string;
0 Q) L5 z5 l( b3 `6 c4 t - str := "I'm OK!";
9 A4 Z3 F$ |; S6 s - str := callLibrary(j,"resetStr",str);5 j) D) u, b3 F
- promptmessage(str);
1 w7 c. x' ^# s) F2 p; } -
: X8 B& Y9 S' P+ X4 y/ _1 n - callLibrary(j, "listAccess", Tablefile);
3 q! }/ ?4 a# {6 W! A" T -
; v. K/ \/ ^9 R. o- l% v - print "Unloading: ", freeLibrary(j);9 W9 |; a2 o* ]. }# j* a& F$ C
- end;
" t) ], ]6 M K- V4 j* D4 U - end;
: D( m. @3 x: I1 g
复制代码 |