Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TCppWebBrowser* and OnMouseMove

27 views
Skip to first unread message

rel...@gmail.com

unread,
Jan 30, 2010, 12:48:54 PM1/30/10
to
using bcbj_code_vol9_num6 as an example, i put in this code, but it
does nothing. my

[code]
void __fastcall TForm1::WebDocumentComplete(TObject *Sender,
LPDISPATCH pDisp, Variant *URL)
{
IHTMLDocument2* pDoc2 = NULL;
Web->Document->QueryInterface(IID_IHTMLDocument2,(void**)&pDoc2);

// Assign desired events
if (pDoc2) {
IHTMLElement* pBody2 = NULL;
pDoc2->get_body(&pBody2);

if (pBody2)
{
TVariant vEventDispatch = CHtmlEvent<TForm1>::Create(this,
&TForm1::OnBrowserMouseMove, DISPID_MOUSEMOVE);
VARIANT_BOOL bSuccess;

((IHTMLElement2*)pBody2)->attachEvent(WideString
("onmousemove"), vEventDispatch, &bSuccess);
pBody2->Release();
}
pDoc2->Release();
}
}
[/code]

my function that should be called is

[code]
void TForm1::OnBrowserMouseMove(DISPID id, VARIANT* pVarResult)
{
ShowMessage("Mouse moved");
}
[/code]

Please help, thanks

0 new messages