在WebBrowser控件打开的网页链接后直接打开而不新弹出IE窗口来打开?解决方法

在WebBrowser控件打开的网页链接后直接打开而不新弹出IE窗口来打开?
我的程序是一个MFC对话框MFC对话框,使用了WebBrowser控件,能够显示网页,可是打开一些连接时,就会新建IE窗口显示网页,郁闷死了.
现在比较菜,请个位哥哥写清楚一点.-_-~


------解决方案--------------------
http://support.microsoft.com/kb/184876
------解决方案--------------------
http://blog.csdn.net/vcmute/archive/2005/10/31/520065.aspx
------解决方案--------------------
帮顶
------解决方案--------------------
创建军事件接口
与WebBrowser连接
响应事件
------解决方案--------------------
void Navigate2(
LPCTSTR lpszURL,
DWORD dwFlags,
CByteArray& baPostedData,
LPCTSTR lpszTargetFrameName = NULL,
LPCTSTR lpszHeader = NULL
);

dwFlags
The flags of a variable that specifies whether to add the resource to the history list, whether to read to or write from the cache, and whether to display the resource in a new window. The variable can be a combination of the values defined by the BrowserNavConstants enumeration.
------解决方案--------------------
Contains values used by the IWebBrowser2::Navigate and IWebBrowser2::Navigate2 methods.

Syntax

typedef enum BrowserNavConstants {
navOpenInNewWindow = 0x1,
navNoHistory = 0x2,
navNoReadFromCache = 0x4,
navNoWriteToCache = 0x8,
navAllowAutosearch = 0x10,
navBrowserBar = 0x20,
navHyperlink = 0x40
} BrowserNavConstants;

Constants

navOpenInNewWindow
Open the resource or file in a new window.


------解决方案--------------------
翻译过来就是说..在调用WebBrowser的Navigate2函数时设置dwFlags,去掉这个navOpenInNewWindow 标志就好了.
------解决方案--------------------
void CSameIEWndDlg::OnStatusTextChangeExplorer1(LPCTSTR Text)
{
DWORD dwServiceType=AFX_INET_SERVICE_HTTP;
CString strServer;
CString strObject;
INTERNET_PORT nPort;

if (::AfxParseURL(Text,dwServiceType,strServer,strObject,nPort))
{
m_strUrl=Text;
}
}

void CSameIEWndDlg::OnNewWindow2Explorer1(LPDISPATCH FAR* ppDisp, BOOL FAR* Cancel)
{
m_wndWebBrowser.Navigate(m_strUrl,NULL,NULL,NULL,NULL);
*Cancel=TRUE;
}