vc中使用MSCOMM控件问题。急!!!
我现在使用MSCOMM控件编写单片机与PC机通讯的程序,可是现在我一点击OK键
调用如下函数来对端口进行设置系统就出错如下:(如果此函数中不添加代码
不会报错)请大侠指点:
我查了MSDN Visusl C++ documentation没什么收获,
我对控件的使用完全是照一份资料上写的。哎!真郁闷
********************************
Debug Assertion Failed!
Program:C:\Program\test_communicata\Debug\test_communcatae.exe
File:winocc.cpp
Line:345
For information on how your program can cause an assertion
failure ,see the Visusl C++ documentation on asserts;
(Press Retry to debug the application)
************************************************
void CTest_communicateDlg::OnOK()
{
// TODO: Add extra validation here
m_comm.SetCommPort(1);
m_comm.SetSettings("4800, N, 8, 1");
m_comm.SetRThreshold(2);
m_comm.SetSThreshold(0);
m_comm.SetInputLen(2);
m_comm.SetInputMode(1);
m_comm.SetPortOpen(TRUE);
CDialog::OnOK();
}
急!!!