Problem with atl vc7 and sinkmap
-
I have a class like this that wraps the webbrowser
template <typename T> class IEHost : public IDispEventSimpleImpl<1, IEHost<T>, &__uuidof(DWebBrowserEvents2)> { ... BEGIN_SINK_MAP(IEHost) SINK_ENTRY_INFO(1, __uuidof(DWebBrowserEvents2), 259, DocumentComplete, &DocumentCompleteInfo) SINK_ENTRY_INFO(1, __uuidof(DWebBrowserEvents2), 250, BeforeNavigate2, &BeforeNavigate2Info) SINK_ENTRY_INFO(1, __uuidof(DWebBrowserEvents2), 102, StatusTextChange, &StatusTextChangeInfo) END_SINK_MAP() ... }
And an atl dialog class that uses itclass StartDlg : public CAxDialogImpl<StartDlg> , public CStrDlg<StartDlg>, public CDialogResize<StartDlg>, public IEHost<StartDlg> { }
This compiled fine with VC6, but with VC7 i get this error. I tried all i can think of to get it to compile but with no luck. Anyone knows how to get it to work in VC7c:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlcom.h(4016): error C2440: 'initializing' : cannot convert from 'const ATL::_ATL_EVENT_ENTRY<T> *' to 'const ATL::_ATL_EVENT_ENTRY<T> *' with [ T=IEHost<StartDlg> ] and [ T=StartDlg ]
/Magnus
- I don't necessarily agree with everything I say
-
I have a class like this that wraps the webbrowser
template <typename T> class IEHost : public IDispEventSimpleImpl<1, IEHost<T>, &__uuidof(DWebBrowserEvents2)> { ... BEGIN_SINK_MAP(IEHost) SINK_ENTRY_INFO(1, __uuidof(DWebBrowserEvents2), 259, DocumentComplete, &DocumentCompleteInfo) SINK_ENTRY_INFO(1, __uuidof(DWebBrowserEvents2), 250, BeforeNavigate2, &BeforeNavigate2Info) SINK_ENTRY_INFO(1, __uuidof(DWebBrowserEvents2), 102, StatusTextChange, &StatusTextChangeInfo) END_SINK_MAP() ... }
And an atl dialog class that uses itclass StartDlg : public CAxDialogImpl<StartDlg> , public CStrDlg<StartDlg>, public CDialogResize<StartDlg>, public IEHost<StartDlg> { }
This compiled fine with VC6, but with VC7 i get this error. I tried all i can think of to get it to compile but with no luck. Anyone knows how to get it to work in VC7c:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlcom.h(4016): error C2440: 'initializing' : cannot convert from 'const ATL::_ATL_EVENT_ENTRY<T> *' to 'const ATL::_ATL_EVENT_ENTRY<T> *' with [ T=IEHost<StartDlg> ] and [ T=StartDlg ]
/Magnus
- I don't necessarily agree with everything I say
-
Don't know, I don't have all info, but just wild shot - try:
template <typename T> class IEHost : public IDispEventSimpleImpl<1, T, &__uuidof(DWebBrowserEvents2)> { ... BEGIN_SINK_MAP(T) ... }
Then it should at least compile ;-) -
I have a class like this that wraps the webbrowser
template <typename T> class IEHost : public IDispEventSimpleImpl<1, IEHost<T>, &__uuidof(DWebBrowserEvents2)> { ... BEGIN_SINK_MAP(IEHost) SINK_ENTRY_INFO(1, __uuidof(DWebBrowserEvents2), 259, DocumentComplete, &DocumentCompleteInfo) SINK_ENTRY_INFO(1, __uuidof(DWebBrowserEvents2), 250, BeforeNavigate2, &BeforeNavigate2Info) SINK_ENTRY_INFO(1, __uuidof(DWebBrowserEvents2), 102, StatusTextChange, &StatusTextChangeInfo) END_SINK_MAP() ... }
And an atl dialog class that uses itclass StartDlg : public CAxDialogImpl<StartDlg> , public CStrDlg<StartDlg>, public CDialogResize<StartDlg>, public IEHost<StartDlg> { }
This compiled fine with VC6, but with VC7 i get this error. I tried all i can think of to get it to compile but with no luck. Anyone knows how to get it to work in VC7c:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\include\atlcom.h(4016): error C2440: 'initializing' : cannot convert from 'const ATL::_ATL_EVENT_ENTRY<T> *' to 'const ATL::_ATL_EVENT_ENTRY<T> *' with [ T=IEHost<StartDlg> ] and [ T=StartDlg ]
/Magnus
- I don't necessarily agree with everything I say
_Magnus_ wrote: BEGIN_SINK_MAP(IEHost) That should probably be
BEGIN_SINK_MAP(IEHost<T> )
--Mike-- Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber There is a saying in statistics that a million monkeys pounding on typewriters would eventually create a work of Shakespeare. Thanks to the Internet, we now know that this is not true. -
_Magnus_ wrote: BEGIN_SINK_MAP(IEHost) That should probably be
BEGIN_SINK_MAP(IEHost<T> )
--Mike-- Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber There is a saying in statistics that a million monkeys pounding on typewriters would eventually create a work of Shakespeare. Thanks to the Internet, we now know that this is not true.No, that dont make any difference. Found what it was, ATL7 have added an AdviseEventSink() call in OnInitdialog() so i got sinked from the wrong class. Should be possible to get a callstack on the freakin template errors.. X| /Magnus
- I don't necessarily agree with everything I say