Hello:
I'm using labwindowscvi5.0.1 to do some work.Now I have a puzzle about my program.I made a dll program in the cvi,and called this dll program in VC++6.0.The dll program is:
i16 iarraybuffer[1000]={0};
f64 darraybuffer[1000]={0.0};
int i;
void DLLEXPORT __stdcall IntConvBufSync(i16 channeln,i16 gain,u32 ulpointnumber,f64 dsamplerate,f64 darray[1000])
{
Timeout_Config (1, 180);
DAQ_Op (1, channeln, gain, iarraybuffer, ulpointnumber, dsamplerate);
DAQ_VScale (1, channeln, gain, 1.0, 0.0, ulpointnumber, iarraybuffer,darraybuffer);
for(i=0;i<1000;i++)
darray[i]=darraybuffer[i];
Timeout_Config (1, -1);
}
the C++ program is:(under win32 console application)
#include
"cvirte.h"
#include "aisinglech1dll.h"
#include "iostream.h"
int main (int argc, char *argv[])
{
int i;
double vcdarray[1000];
IntConvBufSync(1,1,100,1000.0,vcdarray);
for(i=0;i<150;i++)
{
cout<<<"\t"< }
return 1;
}
If change all the number 1000(the size of iarraybuffer,darraybuffer,darray,vcdarray)
to 10000,then the C++ program can only run 5 times and get correct result.when to the six time,it made my system blue screen and restart,and my .cpp code turn to binary code.If I change all the number 10000 to 1000,at present,I have run the C++ program 12 times and get correct result.So I guess whether when I run the sixty time,my system will crash and restart.I hope to know why.If you know,please tell me,thanks.