在MFC中怎样将buffer中的数据保存到一个.txt文件中
OVERLAPPEDinOvLap;LONGlen=512;PUCHARInBuffer=newUCHAR[len];ZeroMemory(InBuffer,len);i...
OVERLAPPED inOvLap;
LONG len=512;
PUCHAR InBuffer =new UCHAR[len];
ZeroMemory(InBuffer, len);
inOvLap.hEvent = CreateEvent(NULL, false, false, "CYUSB_IN");
UCHAR *inContext = InEndpt ->BeginDataXfer(InBuffer ,len,&inOvLap);
InEndpt->WaitForXfer(&inOvLap,2000);
if(InEndpt->FinishDataXfer(InBuffer , len, &inOvLap ,inContext));
else AfxMessageBox("读取传输失败!");
SetDlgItemText(IDC_EDIT_READ,CString(InBuffer));
CloseHandle(inOvLap.hEvent);
delete [] InBuffer;
这个程序,怎么样才可以把我读到的数据放在一个.txt文本里而不是文本编辑框里,该怎么改 展开
LONG len=512;
PUCHAR InBuffer =new UCHAR[len];
ZeroMemory(InBuffer, len);
inOvLap.hEvent = CreateEvent(NULL, false, false, "CYUSB_IN");
UCHAR *inContext = InEndpt ->BeginDataXfer(InBuffer ,len,&inOvLap);
InEndpt->WaitForXfer(&inOvLap,2000);
if(InEndpt->FinishDataXfer(InBuffer , len, &inOvLap ,inContext));
else AfxMessageBox("读取传输失败!");
SetDlgItemText(IDC_EDIT_READ,CString(InBuffer));
CloseHandle(inOvLap.hEvent);
delete [] InBuffer;
这个程序,怎么样才可以把我读到的数据放在一个.txt文本里而不是文本编辑框里,该怎么改 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询