Re: Message Map with multiple inheritance

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



What does the implementation of the timer function look like?
What should the implementation of the timer function look like?
The warning indicates the two do not agree.

So long as your IImporterProcessCallback class does not inherit from CDialog
or CObject then there should be no inheritance issues - this is likely a red
herring.


- Tim


"Burt" <burt@xxxxxxxxxxxxxxxxx> wrote in message
news:VRqne.124131$Yr4.82457@xxxxxxxxxxxxxxxxxxxxxxxxx
>I am pulling out my hair on this one! I want to create a simple message
>map for a timer. I have:
>
> BEGIN_MESSAGE_MAP(ImportProgress, TDialog)
> ON_WM_TIMER()
> END_MESSAGE_MAP()
>
> And the WM_TIMER gives me a compiler error of:
>
> warning C4407: cast between different pointer to member representations,
> compiler may generate incorrect code
>
> (we have "treat warnings as errors" so this prevents me from proceeding).
>
> I think the problem is that my class has multiple inheritance, being
> declared as:
>
> class ImportProgress : public IImporterProcessCallback, public TDialog
>
> using the TDialog (which inherits through 3 other levels and finally
> reaches CDialog) is the message chain I want to use.
>
> Questions:
>
> 1) Am I correct that this is the source of the warning?
>
> 2) Would it be safe to just turn off this one warning? (If so, how do I
> do that? I know there is some compiler directive, but I new to MFC...)
>
> 3) Is there a syntax for message map declarations to give multiple
> inheritors?
>


.



Relevant Pages

  • Re: Odd behavior in 2005 with base page classes
    ... way page inheritance works in 2.0. ... Conversion Wizard adds and you end up with some cases where you get errors ... >I have converted two ASP.NET 1.1 applications to ASP.NET 2.0. ... > Warning 3 'Nwea.BlueWater.GenericError.ApplicationInstance' hides ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: public inheritance of interfaces and virtual (multiple) inheri
    ... I will not cling to the death to use virtual inheritance. ... However, in MFC, you need to declare a pointer to a member of a class ... we can end up corrupting pointers. ... There is a warning, ...
    (microsoft.public.vc.language)
  • Re: Suppress warning
    ... Use of inherited AUTOLOAD for non-method main::c2fis deprecated at ... Is there a way to identify the category of warning so I can suppress it ... currently issues an optional warning when non-methods ... Inheritance will not work when ...
    (comp.lang.perl.misc)
  • Re: public inheritance of interfaces and virtual (multiple) inheritanc
    ... I would like to use public inheritance ... Particularly, I have 2 abstract base interface classes, ... There is a warning, ... Pointers to member functions became 16 byte. ...
    (microsoft.public.vc.language)
  • Re: Why INFINITE loop in a thread occupy so much CPU time??
    ... With the attendant warning about the constant expression. ... This is a common programming technique. ... Good programming practice would consist of using the compiler at ... One can write 'bool' in C++ but not C. ...
    (microsoft.public.vc.mfc)