Getting Context Menu Information
From: Jamie S (creamer72_at_hotmail.com)
Date: 07/16/04
- Next message: Igor Tandetnik: "Re: Automating InternetExplorer & IDocHostUIHandler"
- Previous message: Sergei Shokhor: "Automating InternetExplorer & IDocHostUIHandler"
- Next in thread: Igor Tandetnik: "Re: Getting Context Menu Information"
- Reply: Igor Tandetnik: "Re: Getting Context Menu Information"
- Messages sorted by: [ date ] [ thread ]
Date: 16 Jul 2004 04:18:00 -0700
Hi,
Ive overridden the context menu and want to gain the URL, when a user
right clicks on a link (anchor).
However, although my code compiles fine, it crashes when
right-clicking on a link. I have narrowed the problem to my
queryinterface line. Has anyone got an idea of where i went wrong?
Thanks.
HRESULT FAR EXPORT CCustomControlSite::XDocHostUIHandler::ShowContextMenu(
DWORD dwID,
POINT* /*pptPosition*/,
IUnknown* /*pCommandTarget*/,
IDispatch *pdispReserved)
{
METHOD_PROLOGUE(CCustomControlSite, DocHostUIHandler)
if (dwID == 6) //an anchor (works fine)
{
IHTMLAnchorElement *pElem = NULL;
BSTR bstrURL;
pdispReserved->QueryInterface(IID_IHTMLAnchorElement,(void**)&pElem);
pElem->get_href(&bstrURL);
}
else
AfxMessageBox("Default Menu");
return S_OK;
}
- Next message: Igor Tandetnik: "Re: Automating InternetExplorer & IDocHostUIHandler"
- Previous message: Sergei Shokhor: "Automating InternetExplorer & IDocHostUIHandler"
- Next in thread: Igor Tandetnik: "Re: Getting Context Menu Information"
- Reply: Igor Tandetnik: "Re: Getting Context Menu Information"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|