Monday, December 14, 2009

error C2259: 'ATL::CComObject' : cannot instantiate abstract class, see declaration of 'IContextMenu::GetCommandString'

If your code is working in 32 bit and you are getting this error while you try to build your shell extension in 64 bit than here is the solution. The 64-bit header defines the IContextMenu::GetCommandString function with a different signature than the 32 bit header.
GetCommandString(UINT_PTR,UINT,UINT *,LPSTR,UINT) ---- 64-bit
vs.
GetCommandString(UINT,UINT,UINT *,LPSTR,UINT) - ----32-bit
So change GetCommandString signature according to your build configuration. This is what I did in my sample app and its working fine in 64 bit OS.

No comments:

Post a Comment