Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. Problem with atl vc7 and sinkmap

Problem with atl vc7 and sinkmap

Scheduled Pinned Locked Moved ATL / WTL / STL
csharphelpc++visual-studiotutorial
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • _ Offline
    _ Offline
    _Magnus_
    wrote on last edited by
    #1

    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 it class 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 VC7 c:\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

    G M 2 Replies Last reply
    0
    • _ _Magnus_

      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 it class 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 VC7 c:\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

      G Offline
      G Offline
      geo_m
      wrote on last edited by
      #2

      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 ;-)

      _ 1 Reply Last reply
      0
      • G geo_m

        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 ;-)

        _ Offline
        _ Offline
        _Magnus_
        wrote on last edited by
        #3

        No, dont compile then either, i get 21 errors on the BEGIN_SINK_MAP/SINK_ENTRY_INFO macros. :sigh: Tried changing those params every way that seems somewhat resonable with no luck. /Magnus


        - I don't necessarily agree with everything I say

        1 Reply Last reply
        0
        • _ _Magnus_

          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 it class 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 VC7 c:\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

          M Offline
          M Offline
          Michael Dunn
          wrote on last edited by
          #4

          _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.

          _ 1 Reply Last reply
          0
          • M Michael Dunn

            _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.

            _ Offline
            _ Offline
            _Magnus_
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups