int CIMChat::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CDialog::OnCreate(lpCreateStruct) == -1)
return -1; CCreateContext pContext;
CWnd* pFrameWnd =this;
pContext.m_pCurrentDoc = new CMyDocument;
pContext.m_pNewViewClass = RUNTIME_CLASS(CHtmlView);//CHTMLEdView
m_WebViewRecv =(CHtmlView*)((CFrameWnd*)pFrameWnd)->CreateView(&pContext);//CHTMLEdView
ASSERT(m_WebViewRecv);
m_WebViewRecv->ShowWindow(SW_NORMAL);
CRect rectWindow;
rectWindow.left=10;
rectWindow.bottom=50;
rectWindow.right =50;
rectWindow.top =1;
m_WebViewRecv->MoveWindow(rectWindow);//10,140,840,620
m_WebViewRecv->Navigate( L"about:blank" ,NULL,NULL,NULL,NULL) ; pContext.m_pCurrentDoc = new CMyDocument;
pContext.m_pNewViewClass = RUNTIME_CLASS(IHtmlEditView);//CHTMLEdView
m_WebViewSend =(IHtmlEditView*)((CFrameWnd*)pFrameWnd)->CreateView(&pContext);//CHTMLEdView
ASSERT(m_WebViewSend);
m_WebViewSend->ShowWindow(SW_NORMAL);
rectWindow.left=10;
rectWindow.bottom=50;
rectWindow.right =50;
rectWindow.top =1;
m_WebViewSend->MoveWindow(rectWindow); //10,140,840,620//
m_WebViewSend->Navigate( L"about:blank" ,NULL,NULL,NULL,NULL) ;
HRESULT hr;
LPDISPATCH pDisp; pDisp = m_WebViewRecv->GetHtmlDocument();
hr = pDisp->QueryInterface(IID_IHTMLDocument2, (LPVOID*)&spDocRecv);
ASSERT(spDocRecv);
pDisp->Release(); m_WebViewSend->GetDHtmlDocument(&spDocSend);
ASSERT(spDocSend); return 0;
}
代码如上,在一个dialog里面!创建之后spDocRecv,spDocSend得不到指针在window2000下,而且会弹出一个对话框显示下在创建错误日志,在xp下有时也会得不到!请问一下是为什么?
{
if (CDialog::OnCreate(lpCreateStruct) == -1)
return -1; CCreateContext pContext;
CWnd* pFrameWnd =this;
pContext.m_pCurrentDoc = new CMyDocument;
pContext.m_pNewViewClass = RUNTIME_CLASS(CHtmlView);//CHTMLEdView
m_WebViewRecv =(CHtmlView*)((CFrameWnd*)pFrameWnd)->CreateView(&pContext);//CHTMLEdView
ASSERT(m_WebViewRecv);
m_WebViewRecv->ShowWindow(SW_NORMAL);
CRect rectWindow;
rectWindow.left=10;
rectWindow.bottom=50;
rectWindow.right =50;
rectWindow.top =1;
m_WebViewRecv->MoveWindow(rectWindow);//10,140,840,620
m_WebViewRecv->Navigate( L"about:blank" ,NULL,NULL,NULL,NULL) ; pContext.m_pCurrentDoc = new CMyDocument;
pContext.m_pNewViewClass = RUNTIME_CLASS(IHtmlEditView);//CHTMLEdView
m_WebViewSend =(IHtmlEditView*)((CFrameWnd*)pFrameWnd)->CreateView(&pContext);//CHTMLEdView
ASSERT(m_WebViewSend);
m_WebViewSend->ShowWindow(SW_NORMAL);
rectWindow.left=10;
rectWindow.bottom=50;
rectWindow.right =50;
rectWindow.top =1;
m_WebViewSend->MoveWindow(rectWindow); //10,140,840,620//
m_WebViewSend->Navigate( L"about:blank" ,NULL,NULL,NULL,NULL) ;
HRESULT hr;
LPDISPATCH pDisp; pDisp = m_WebViewRecv->GetHtmlDocument();
hr = pDisp->QueryInterface(IID_IHTMLDocument2, (LPVOID*)&spDocRecv);
ASSERT(spDocRecv);
pDisp->Release(); m_WebViewSend->GetDHtmlDocument(&spDocSend);
ASSERT(spDocSend); return 0;
}
代码如上,在一个dialog里面!创建之后spDocRecv,spDocSend得不到指针在window2000下,而且会弹出一个对话框显示下在创建错误日志,在xp下有时也会得不到!请问一下是为什么?
解决方案 »
- mfc对话框使用webbrowser控件编程时如何屏蔽右键和不开IE新窗?
- 关于ADO的问题,插入记录的问题
- 共享DLL和 statically连接库
- ActiveX控件注册失败,提示“内存分配访问无效"
- 关于Draw3DRect函数的使用(此致那个敬礼,在线等)
- 类型转换问题,在线等待中~~~
- 关于CString和String。。我越来越糊涂了 :(
- 有谁知道远程登陆的WINDOWS的就象,操作自己电脑一样的那个叫PC什么的软件,那里有下载
- 关于Windows下打开文件的一点问题,求解。
- 关于operation valid only when the port is open
- MFC实现的ActiveX控件如何与ASP交互
- D3D模型移动的问题
IHtmlEditView *m_WebViewSend;// CFont m_FontStyle; IHTMLDocument2 *spDocRecv;
IHTMLDocument2 *spDocSend; 上面的变量如下 !!