ATL, error C2385: ambiguous access of 'ProcessWindowMessage' of BEGIN_MSG_MAP,

drjackool 956 Reputation points
2023-08-06T04:41:00.74+00:00

Hi

Platform: Win32/ATL

I created my classes like below but compiler error C2385: ambiguous access of 'ProcessWindowMessage' rises

Thanks

class base : public ATL:CWindow
{
public:
	BEGIN_MSG_MAP(base)
		//...
	END_MSG_MAP()
};

class drived : public ATL:CWindowImpl<drived, base>
{
public:
	BEGIN_MSG_MAP(base)
		//...
	END_MSG_MAP()
};
Windows development | Windows API - Win32
Developer technologies | C++
{count} votes

Accepted answer
  1. RLWA32 49,541 Reputation points
    2023-08-06T08:50:24.1933333+00:00

    It's not clear what you are trying to do here.

    Inheriting directly from CWindow and declaring a message map seems to be the problem. Remove the message map from class 'base" and according to the ATL documentation the BEGIN_MSG_MAP macro in class derived should reference derived, not base. Don't forget that other ATL Window classes inherit from CMessageMap which contains a virtual ProcessWindowMessage function.

    2 people found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.