vc中使用MSCOMM控件问题。急!!!

tansir728 2003-08-20 05:11:46
我现在使用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();
}
急!!!
...全文
89 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
Hermit 2003-08-20
  • 打赏
  • 举报
回复
http://www.gjwtech.com/vcandc/scommassistantcode.htm ---vc

http://members.lycos.co.uk/avrmcu/html/example.htm ---delphi

27,374

社区成员

发帖
与我相关
我的任务
社区描述
硬件/嵌入开发 单片机/工控
社区管理员
  • 单片机/工控社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧