- is6 L* N( K+ i' d1 R3 W+ v
- r:real; file:string;
+ L9 d2 X: Y$ q0 u+ }4 k9 K9 x- h# t - do
. G4 \5 n6 ~7 k7 A( j - openConsole;
8 \# }- i3 ]: |; ]
, m, N/ q. Y0 c* N- H* P2 u- /*
6 \+ \ [5 h4 e* Q - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",' }+ y% U5 j; m% ]# y# |
- when is64BitApplication then 64 else 32,0 A% h" i6 W. U+ ^6 \- q/ ^
- "bit.dll");3 |; v5 x7 P# P: ?# r& e- E
- */
+ z* i* N, v2 }" i3 p7 N - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
- G7 P z2 F7 K' Z. k - local j := loadLibrary(file);
/ q) M1 ?$ Q0 d5 U5 R+ e w" ]
/ X" s4 j/ \! s- if j > 0 then
$ }) ^7 z5 {. h0 M! a+ a7 i8 A - print getLoadedLibrary(j)," is loaded.";1 }1 J. ~, z2 I: m
- . \ t2 N: L, w% R6 Y: S
- r := callLibrary(j, "calcSin", PI/6);. t$ S- z: {( E1 v6 K8 t
- promptmessage(to_str("sin(PI/6) = ", r));' R/ q3 |. P, x. I
- # X9 f8 o% q `
- local str:string;) C/ i. v$ n: {$ W; d% `7 A
- str := "I'm OK!";
+ B1 K! w. l% D6 h( J V - str := callLibrary(j,"resetStr",str);
; {0 n; U1 A U5 ? - promptmessage(str);
+ `/ B& @; a0 O6 n+ b+ U -
. F4 h% M. T" W$ y- r& p- g2 p - callLibrary(j, "listAccess", Tablefile);
" @& D. P/ b2 w! o( _) F: v - 9 |) P) H) r V! `
- print "Unloading: ", freeLibrary(j);
# E/ Q. X+ p) X) \ - end;
8 H$ H) h* `' K1 N' ~ - end;0 f( o' Q H7 X2 l3 {. {
复制代码 |