小弟想通過(guò)CH376從FPGA上傳70個(gè)數(shù)據(jù)給PC機(jī)上的應(yīng)用程序,但是在按下接收上傳數(shù)據(jù)的按鈕時(shí)應(yīng)用程序就卡死,VC程序的主要代碼如下: void CUsb_testDlg::OnButton2() { // TODO: Add your control notification handler code here char oBuffer[100]; unsigned long i=70; CH375OpenDevice(0);
SetDlgItemInt(IDC_EDIT3,CH375QueryBufUpload(0));
CH375ReadData(0,&oBuffer,&i); //讀取上傳數(shù)據(jù) SetDlgItemText(IDC_EDIT1,oBuffer); //顯示上傳數(shù)據(jù) SetDlgItemInt(IDC_EDIT2,i); }
此外,在OnInitDialog()初始化時(shí)還加了以下兩句代碼: CH375SetTimeout(0,5000,5000); CH375SetBufUpload(0,1);
就這樣,只要按下按鈕時(shí)應(yīng)用程序就卡死!請(qǐng)大家不吝賜教!指導(dǎo)指導(dǎo)!