- is- j) h+ m5 |, V3 d2 n+ F
- r:real; file:string;! Q0 S8 H! B5 Q$ h8 j" M
- do0 R5 [& i- \; ^: C: @
- openConsole;
9 U5 G9 D2 F& ~- F" T
% J9 i5 ^' ^) O- /*
1 k- Z! G( j+ M# k - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
8 M2 L) E& O, W9 f - when is64BitApplication then 64 else 32,5 h/ v8 S$ U' {- v& q% }
- "bit.dll");
) s# S- k& M" N. a& s - */, X; U7 g. h2 ~$ a( S: R7 b
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
" Q# Z- m& m& e/ r: c+ N7 l- ^) m - local j := loadLibrary(file);
* H; _# X, p+ _% P9 U/ N% r
9 y; s0 w. f/ x7 p7 J- if j > 0 then+ ~2 ~& x% m' q
- print getLoadedLibrary(j)," is loaded.";
" a3 N( t0 L3 m7 _( B9 }
- q6 F+ C% p" X+ m+ M, y0 @- r := callLibrary(j, "calcSin", PI/6);- Z' X) i8 H. T3 F* ^( j
- promptmessage(to_str("sin(PI/6) = ", r));* t# y# D( w& y' A6 {
- + C7 _+ H2 D* \( q4 h* O, |3 m4 o& }
- local str:string;& T' Y$ A9 a7 @& e
- str := "I'm OK!";
9 T0 t4 V. U8 P5 c. D# p% C - str := callLibrary(j,"resetStr",str);
% x+ h2 D* m/ b, _ I6 U$ l - promptmessage(str);4 L- Z2 s* n( B. g$ U
-
& v4 e& E% {9 Y3 C5 M9 S9 V7 C - callLibrary(j, "listAccess", Tablefile);
/ o/ _- S) s, I- l$ B8 i - ( o3 M9 q! i9 G0 V$ X i' g
- print "Unloading: ", freeLibrary(j);3 d& Y; @5 h4 }" s
- end;
9 i: g7 ]* h# Q0 q# ^/ | - end;; W" X5 [( {; t' k: D9 b& N
复制代码 |