@平原君 你好,想跟你请教个问题:
void TCPScan::OnScanStart() { // TODO: Add your control notification handler code here GetDlgItem(IDC_ScanStart)->EnableWindow(FALSE); bStop = false; bPause = false; ThreadParament *param = new ThreadParament; memset(param,0,sizeof(ThreadParament)); DWORD startip,endip; this->m_ipfrom.GetAddress(startip); this->m_ipto.GetAddress(endip); param->dwOriginalIP = startip; if(this->m_ifsingleip) { param->dwLastIP =startip; } else { param->dwLastIP = endip; } this->UpdateData(true); param->dwOriginalPort = this->m_portfrom; if(m_ifsingleport) { param->dwLastPort = this->m_portfrom; } else { param->dwLastPort = this->m_portto; } this->UpdateData(false); param->dwTimeOut = 2; AfxGetApp()->m_pMainWnd->SendMessage(WM_SCAN_START,WPARAM(param),scantype); }
其中,ThreadParament的代码为:
struct ThreadParament { DWORD dwOriginalIP,dwLastIP,dwOriginalPort,dwLastPort,dwTimeOut,dwTimeForOnePort,dwPacketNo; pcap_if_t *SelectDev; char HostMac[6]; DWORD dwHostIP,dwNetMAsk,dwDefaultGateway,dwTimeBetweenToPackets; };
AfxGetApp()->m_pMainWnd->SendMessage(WM_SCAN_START,WPARAM(param),scantype);报错。单步调试时,运行到afxwin2.inl中这一处时,报上面的错误:
对话框有m_pmainwnd?看看APP类里赋值了没楼上说的差不多,一般爆出这种错误的,都是一个指针未赋值或者数组越界,结合你的描述来看,应该就是m_pMainWnd没有赋值了。另外,你的问题提的很详细,这样才是好的提问,不然我想回答都未必能回答的了。<divclass="ref">
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。