Re: Error C2259 while building application on 64-bit
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Tue, 19 Dec 2006 00:59:44 -0500
Well, if those methods are indeed PURE methods, then the diagnostics are correct: you
can't instantiate a class that has PURE virtual methods, only one which is a subclass that
has actual implementations of all those methods. If class A has
class A {
virtual A1() PURE;
virtual A2() PURE;
}
any attempt to write
new A;
will fail with the errors you see. If you derive class B
class B: public A {
virtual A1() {...}
};
then you can't instantiate
new B;
because the method A2 is not defined. But if you have
class C: public B {
virtual A2() {...}
}
then you can instantiate
new C;
So I don't believe that this could compile under a 32-bit compiler of any flavor. Is
there some conditional compilation that is bypassing the instantiation?
joe
On 18 Dec 2006 20:00:44 -0800, shikhar.ntds@xxxxxxxxx wrote:
Hi Joseph,Joseph M. Newcomer [MVP]
Thanks alot for your reply.
Track back and see if those methods really are virtual PURE methods.
Yes all of them are PURE virtual methods.
Of course, there's always a chance that the Win64 library isI think this is the role of compiler + linker to take care that the
different somehow, and it would be worth comparing the header file you use in the 32-bit
build to the header file you use in the 64-bit build.
correct versions of the headers and functions are linked. I have
checked and they are both using the same verison of header file.
Regards,
Shikhar
Joseph M. Newcomer wrote:
See below...
On 18 Dec 2006 02:06:52 -0800, shikhar.ntds@xxxxxxxxx wrote:
Hi All,*****
I am trying to build my app for 64bit system (which builds fine for
32-bit).
While building it on 64-bit i am getting error C2259 at the call:
COM_INTERFACE_ENTRY_TEAR_OFF( __uuidof(IShellFolder), CMyShellFolder)
in my code.
The build log says:
d:\testapp\ext\sdk\vs8rtm\sdk\include\atl80\atlcom.h(1828) : error
C2259: 'ATL::CComTearOffObject<Base>' : cannot instantiate abstract
class
with
[
Base=CMyShellFolder
]
due to following members:
'HRESULT IPersistFolder::Initialize(LPCITEMIDLIST)' : is
abstract
d:\testapp\ext\sdk\vs8rtm\sdk\include\shobjidl.h(816) : see
declaration of 'IPersistFolder::Initialize'
'HRESULT
IShellFolder::ParseDisplayName(HWND,LPBC,LPOLESTR,ULONG *,LPITEMIDLIST
*,ULONG *)' : is abstract
d:\testapp\ext\sdk\vs8rtm\sdk\include\shobjidl.h(1398) : see
declaration of 'IShellFolder::ParseDisplayName'
'HRESULT IShellFolder::BindToObject(LPCITEMIDLIST,LPBC,const
IID &,void **)' : is abstract
d:\testapp\ext\sdk\vs8rtm\sdk\include\shobjidl.h(1411) : see
declaration of 'IShellFolder::BindToObject'
'HRESULT IShellFolder::BindToStorage(LPCITEMIDLIST,LPBC,const
IID &,void **)' : is abstract
d:\testapp\ext\sdk\vs8rtm\sdk\include\shobjidl.h(1417) : see
declaration of 'IShellFolder::BindToStorage'
'HRESULT
IShellFolder::CompareIDs(LPARAM,LPCITEMIDLIST,LPCITEMIDLIST)' : is
abstract
d:\testapp\ext\sdk\vs8rtm\sdk\include\shobjidl.h(1423) : see
declaration of 'IShellFolder::CompareIDs'
'HRESULT IShellFolder::GetAttributesOf(UINT,LPCITEMIDLIST
*,SFGAOF *)' : is abstract
d:\testapp\ext\sdk\vs8rtm\sdk\include\shobjidl.h(1433) : see
declaration of 'IShellFolder::GetAttributesOf'
'HRESULT IShellFolder::GetUIObjectOf(HWND,UINT,LPCITEMIDLIST
*,const IID &,UINT *,void **)' : is abstract
d:\testapp\ext\sdk\vs8rtm\sdk\include\shobjidl.h(1438) : see
declaration of 'IShellFolder::GetUIObjectOf'
'HRESULT
IShellFolder::GetDisplayNameOf(LPCITEMIDLIST,SHGDNF,STRRET *)' : is
abstract
d:\testapp\ext\sdk\vs8rtm\sdk\include\shobjidl.h(1446) : see
declaration of 'IShellFolder::GetDisplayNameOf'
'HRESULT
IShellFolder::SetNameOf(HWND,LPCITEMIDLIST,LPCOLESTR,SHGDNF,LPITEMIDLIST
*)' : is abstract
d:\testapp\ext\sdk\vs8rtm\sdk\include\shobjidl.h(1451) : see
declaration of 'IShellFolder::SetNameOf'
d:\testapp\ext\sdk\vs8rtm\sdk\include\atl80\atlcom.h(1818) :
while compiling class template member function 'HRESULT
ATL::CComInternalCreator<T1>::CreateInstance(void *,const IID &,LPVOID
*)'
with
[
T1=ATL::CComTearOffObject<CMyShellFolder>
]
d:\testapp\ext\sdk\vs8rtm\sdk\include\atl80\atlcom.h(1899) :
see reference to class template instantiation
'ATL::CComInternalCreator<T1>' being compiled
with
[
T1=ATL::CComTearOffObject<CMyShellFolder>
]
d:\testapp\ext\sdk\vs8rtm\sdk\include\atl80\atlcom.h(1899) :
while compiling class template static data member
'ATL::_ATL_CREATORDATA ATL::_CComCreatorData<Creator>::data'
with
[
Creator=ATL::CComInternalCreator<ATL::CComTearOffObject<CMyShellFolder>>
]
I have seen the documentation of this error and it says that it occurs
mainly due to interface not implemented in deried class but in the
current scenario it is working fine with 32-bit machines (not with
64-bit build).
Which 32-bit build? VS6 was sometimes a lot more forgiving of C++ violations (although it
shouldn't have allowed this, either) than modern C++ compilers.
Unfortunately, I've only done one shell extension, so I'm not familiar with the classes
involved, so I can't really help much here. Track back and see if those methods really
are virtual PURE methods. Of course, there's always a chance that the Win64 library is
different somehow, and it would be worth comparing the header file you use in the 32-bit
build to the header file you use in the 64-bit build. Beyond that, I can't offer much
advice.
joe
****
Joseph M. Newcomer [MVP]
Can anyone please help me resolve this issue.
Thanks alot.
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- References:
- Error C2259 while building application on 64-bit
- From: shikhar . ntds
- Re: Error C2259 while building application on 64-bit
- From: Joseph M . Newcomer
- Re: Error C2259 while building application on 64-bit
- From: shikhar . ntds
- Error C2259 while building application on 64-bit
- Prev by Date: Re: MFC TIMER
- Next by Date: Re: Does 'WideCharToMultiByte' handle surrogate pairs?
- Previous by thread: Re: Error C2259 while building application on 64-bit
- Next by thread: accessing extern varible form a dll
- Index(es):
Relevant Pages
|
Loading