troubleshooting Question

ATL com error C2385

Avatar of madhav119
madhav119 asked on
Visual C++.NETMicrosoft Applications
1 Comment1 Solution827 ViewsLast Modified:

I have created a new class CTestBaseClass derived from AxDialogImpl. Added some specialized code in OnInitDialog of this class.
I want to derive all ATL dialog classes (classes derived from CAxDialogImpl) in my project to be derived CTestBaseClass so that I invoke CTestBaseClass::OnInitDialog() in
OnInitDialog of all the ATL classes (to make use of the specialised code )in my project. My code looks something like this.


class CTestBaseClass : CAxDialogImpl

LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
      CAxDialogImpl<CTestBaseClass >::OnInitDialog(uMsg, wParam, lParam, bHandled);
                //specialized code
      return 1;  // Let the system set the focus


class CMYDerivedClass:
    public CAxDialogImpl<CFilterDlg>,
    public IDispEventImpl< IDC_XB, CMYDerivedClass>,
    public IPropertyNotifySinkImpl<CMYDerivedClass>,  
    public CTestBaseClass



When I do this I get following comilation errors. Please help on resolving these issues.Thanks in advance.

c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\atlcom.h(4769): error C2385: ambiguous access of 'm_hWnd'
          could be the 'm_hWnd' in base 'ATL::CWindow'
          or could be the 'm_hWnd' in base 'ATL::CWindow'
          c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\atlwin.h(4126) : see reference to function template instantiation 'HRESULT ATL::AtlAdviseSinkMap<T>(T *,bool)' being compiled
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 1 Comment.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros