migration from VC6 to VS2005
Hello,
We are currently migrating from VC6 compiler to VS2005 compiler. While
building a particular component the following compiler error is
encountered.
C:\Program Files\Microsoft Visual Studio 8\VC\ATLMFC\INCLUDE
\atlcom.h(3486) : error C2664:
'ATL::CComObjectCached<Base>::CreateInstance' : cannot convert
parameter 1 from 'ATL::CComObjectCached<Base> **' to
'ATL::CComObjectCached<Base> **'
1> with
1> [
1> Base=ASS::CADS_Store
1> ]
1> and
1> [
1> Base=ASS::CADS_Store
1> ]
1> and
1> [
1> Base=tracing::Base
1> ]
1> Types pointed to are unrelated; conversion requires
reinterpret_cast, C-style cast or function-style cast
1> C:\Program Files\Microsoft Visual Studio 8\VC\ATLMFC\INCLUDE
\atlcom.h(3466) : while compiling class template member function
'HRESULT
ATL::CComClassFactorySingleton<T>::CreateInstance(LPUNKNOWN,const IID
&,void **)'
1> with
1> [
1> T=ASS::CADS_Store
1> ]
1> C:\Program Files\Microsoft Visual Studio 8\VC\ATLMFC\INCLUDE
\atlcom.h(2707) : see reference to class template instantiation
'ATL::CComClassFactorySingleton<T>' being compiled
1> with
1> [
1> T=ASS::CADS_Store
1> ]
1> C:\Program Files\Microsoft Visual Studio 8\VC\ATLMFC\INCLUDE
\atlcom.h(1792) : see reference to class template instantiation
'ATL::CComObjectNoLock<Base>' being compiled
1> with
1> [
1> Base=ATL::CComClassFactorySingleton<ASS::CADS_Store>
1> ]
1> C:\Program Files\Microsoft Visual Studio 8\VC\ATLMFC\INCLUDE
\atlcom.h(1781) : while compiling class template member function
'HRESULT ATL::CComCreator<T1>::CreateInstance(void *,const IID
&,LPVOID *)'
1> with
1> [
1>
T1=ATL::CComObjectNoLock<ATL::CComClassFactorySingleton<ASS::CADS_Store>>
1> ]
1> .\ASS.cpp(157) : see reference to class template
instantiation 'ATL::CComCreator<T1>' being compiled
1> with
1> [
1>
T1=ATL::CComObjectNoLock<ATL::CComClassFactorySingleton<ASS::CADS_Store>>
1> ]
The error points to 'OBJECT_ENTRY(CLSID_ADS_Store, CADS_Store)' in our
code. CADS_Store class is defined as follows:
class ATL_NO_VTABLE CADS_Store :
public CComObjectRootEx<CComMultiThreadModel>,
public CComCoClass<CADS_Store, &CLSID_ADS_Store>,
public IDispatchImpl<IADS_Store, &IID_IADS_Store, &LIBID_ASSLib>,
public tracing::Base
{...};
'tracing::Base' is a user defined class used for tracing. When this
class name is changed to 'tracing::TracingBase' for instance the
component builds without any compiler error.
Is usage of class-name 'Base' conflicting?
Kindly let me the reason for above behavior.
Thanks in advance.
Any help is highly appreciated.
Regards,
Ayesha.