用CHtmlView作为基类.实现多标签浏览器.在OnDocumentComplete中实现子窗口关闭.能编译通过.运行时出现:"程序遇到问题需要关闭"这个错误.代码如下:
void CMIEView::OnDocumentComplete(LPCTSTR lpszUrl)
{
// make sure the main frame has the new URL.  This call also stops the animation
((CMainFrame*)GetParentFrame())->SetAddress(lpszUrl); if(theWindowTab.GetItemCount()>2)
{
SendMessage(WM_COMMAND,ID_FILE_CLOSE);
}}这个命令是从菜单命令上拷过的.为什么会出现这个错误