Link to home
Start Free TrialLog in
Avatar of madhav119
madhav119

asked on

ATL com error C2385

Hi,

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.

ex:

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
          with
          [
ASKER CERTIFIED SOLUTION
Avatar of ambience
ambience
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial