- is3 M* H, s z6 o3 V2 U
- r:real; file:string;
4 R3 m- s% |5 q8 R, W8 Q - do
; H3 @/ H% L4 Z4 ] - openConsole;
, p5 |+ F9 D& F& q0 |' O7 \ - 9 ]4 j! ? `7 O- l) p
- /*( d4 B) @4 G' ?2 a7 s N
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
- N! ~+ @ g+ `; F8 Z2 S/ _ - when is64BitApplication then 64 else 32,
0 V/ U$ H6 n B) T# n- Y) X8 U - "bit.dll");
( `. e9 O" K1 Y5 t" y - */+ ~: C8 L; G4 {% x% {
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";, W* {( Y. V1 Z/ v% Q
- local j := loadLibrary(file);
4 ?" Q! j' R& {$ L9 J
! r5 w& R$ H5 i7 m- if j > 0 then
' b3 B3 X3 Q' m' s$ T8 n" ] - print getLoadedLibrary(j)," is loaded.";
e- ^$ T8 K* a, E3 v9 [& t7 f - 9 V8 k1 R+ R, b! k7 {. f
- r := callLibrary(j, "calcSin", PI/6);
! `+ }0 C' ^- f" d - promptmessage(to_str("sin(PI/6) = ", r));4 ^8 B) C2 l) f3 H. {) j
-
6 f |3 H0 g: |' Y - local str:string;4 D. Q7 M! i1 e& h, d6 F A& n4 f
- str := "I'm OK!";2 Y' l+ r2 p8 [
- str := callLibrary(j,"resetStr",str);; C& W" B+ I. I- i9 ~
- promptmessage(str);
& j$ {3 J% b3 r. o, V$ H6 O" J -
, H( w2 V8 h: f" V - callLibrary(j, "listAccess", Tablefile);
8 _1 s0 k7 `. B+ \3 r! r& m; X - 4 u* O' c! z3 v; h! t- I9 {
- print "Unloading: ", freeLibrary(j);$ {/ g, E P2 `, K; G
- end;
d/ q; V/ N# ? T. V" [ - end;
[/ e+ N& L" _( _1 g5 z
复制代码 |