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