kareshi

Hi all

Just want to ask how to retrieve the string( ) value of the TargetFrameName parameter in webbrowser control's BeforeNavigate2 event:

void CMyClass::BeforeNavigate2Explorertestnews(LPDISPATCH pDisp,
VARIANT* URL,
VARIANT* Flags,
VARIANT* TargetFrameName,
VARIANT* PostData,
VARIANT* Headers,
BOOL* Cancel)
{

CString strLink = (CString)URL->bstrVal;

AfxMessageBox(strLink); // it works, the URL is displayed in the messagebox

CString strTargetFrameName = (CString)TargetFrameName->bstrVal;

// it displays a blank messagebox even if the href's tag target's attribute is set to

// "_self"

AfxMessageBox(strTargetFrameName);

}

The goal here is to retreive the attribute(_blank, _self, etc) of the target tag of the active link in the webbrowser control when clicked.

For ex: <a href=http://testsite123492.com target="_self">

Thank you

k



Re: Visual C++ General Webbrowser control's BeforeNavigate2 event question

Simple Samples

Try looking at http://forums.microsoft.com/MSDN/Search/Search.aspx words=BeforeNavigate2+&lcid=9&SiteID=1&searchscope=&CSVUserID=&localechoice=9

There are other forums where there are questions about BeforeNavigate2. The question is off-topic for this forum however. There are also newsgroups and other sites with forums that this question is appropriate for.