Re: Error C2259 while building application on 64-bit



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
****

Can anyone please help me resolve this issue.

Thanks alot.
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: Error C2259 while building application on 64-bit
    ... build to the header file you use in the 64-bit build. ... 'HRESULT IPersistFolder::Initialize': is ... declaration of 'IShellFolder::ParseDisplayName' ... while compiling class template member function 'HRESULT ...
    (microsoft.public.vc.mfc)
  • Error C2259 while building application on 64-bit
    ... 'HRESULT IPersistFolder::Initialize': is ... declaration of 'IShellFolder::ParseDisplayName' ... while compiling class template member function 'HRESULT ...
    (microsoft.public.vc.atl)
  • Error C2259 while building application on 64-bit
    ... 'HRESULT IPersistFolder::Initialize': is ... declaration of 'IShellFolder::ParseDisplayName' ... while compiling class template member function 'HRESULT ...
    (microsoft.public.vc.mfc)
  • Re: Error C2259 while building application on 64-bit
    ... Well, if those methods are indeed PURE methods, then the diagnostics are correct: ... then you can't instantiate ... 'HRESULT IPersistFolder::Initialize': is ... declaration of 'IShellFolder::ParseDisplayName' ...
    (microsoft.public.vc.mfc)
  • Re: WMI/WBem console app: access violation
    ... safecall; external 'activeds.dll'; ... That's not the right declaration. ... function that returns HResult, so you cannot provide that return value ... When you call a safecall function, the compiler will check the ...
    (comp.lang.pascal.delphi.misc)