我使用如下的方法:
BEGIN_DHTML_EVENT_MAP(CMyView)
DHTML_EVENT(0x000003ff,NULL,oncontextmenu)
END_DHTML_EVENT_MAP()
我想把 document 对象的oncontextmenu事件映射到我的oncontextmenu
msdn 中说
DHTML_EVENT(dispid, elemName, memberFxn )elemName
An LPCWSTR holding the ID of the HTML element sourcing the event, or NULL to handle document events.
也就是说ID ==NULL 默认映射Document 对象的事件,实际使用的的时候,发现映射根本就没有成功,不知道为什么?如何映射documnet的事件那
BEGIN_DHTML_EVENT_MAP(CMyView)
DHTML_EVENT(0x000003ff,NULL,oncontextmenu)
END_DHTML_EVENT_MAP()
我想把 document 对象的oncontextmenu事件映射到我的oncontextmenu
msdn 中说
DHTML_EVENT(dispid, elemName, memberFxn )elemName
An LPCWSTR holding the ID of the HTML element sourcing the event, or NULL to handle document events.
也就是说ID ==NULL 默认映射Document 对象的事件,实际使用的的时候,发现映射根本就没有成功,不知道为什么?如何映射documnet的事件那
如何知道哪
{
static CLSID const clsid
= { 0x8856f961, 0x340a, 0x11d0, { 0xa9, 0x6b, 0x0, 0xc0, 0x4f, 0xd7, 0x5, 0xa2 } };
return clsid;
}
virtual BOOL Create(LPCTSTR lpszClassName,
LPCTSTR lpszWindowName, DWORD dwStyle,
const RECT& rect,
CWnd* pParentWnd, UINT nID,
CCreateContext* pContext = NULL)
{ return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID); }该控件创建时应该指定一个ID值,该值不与同一对话框或者同一窗口内的其他控件ID重复就可以了
能不能给个详细的说明
This dispinterface provides a connection point so that an application or control can intercept events fired by an element.Header and IDL files mshtml.h, mshtml.idl
建议你贴你document创建的相关代码
http://www.vchelp.net/wyy/paper/z_html_dlg.asp