none
Plug-in algorithm shell complilation error

    Question

  • I'm trying to create plug-in algorithm using tutorial from Max Chickering and Raman Iyer. I follow steps very carefully and as far as I know my code is exactly the same as Completed shell solution in source files of tutorial. But when I try to compile factory.cpp file I get this error:
    Error    1    error C2259: 'ATL::CComObject<Base>' : cannot instantiate abstract class    e:\development\ms visual studio 2005\vc\atlmfc\include\atlcom.h    1799  

    When I compile completed shell solution from source files it's OK. Do you have any ideas, where the problem could be?

    Thank you

    Wednesday, August 29, 2007 3:27 PM

Answers

  •  

    I was facing this same problem. But i got this issue when i converted my old VC6 project in VC2005. After conversion while compiling i was getting folloing

    Error    1    error C2259: 'ATL::CComObject<Base>' : cannot instantiate abstract class    XXXX 2005\vc\atlmfc\include\atlcom.h    1799  

     

    then i checked i was having few undefined exposed Functions in IDL. when i cleared them my project started compiling successfully

     

    Virat

    Wednesday, April 9, 2008 4:16 AM

All replies

  • This most likely indicates that you haven't provided implementation for all the abstract methods from IDMAlgorithm interface. Unfortunately, the error does not point you to that, but rather fails in the code which instantiates the class (cannot instantiate an abstract class).

     

    Hope this helps

    Shuvro

    Wednesday, September 5, 2007 12:20 AM
    Answerer
  •  

    The error window of VS only includes this error fragment. However, if you check the Output window after the failed compilation, you will find details about the virtual method that lacks implementation.

    Once you find the name of the missing method, you can search it (VS Ctrl+Shift+F, Find in Files) in the original sample source code. Make sure the file containing the code for that method is included and available in your copy of the sample

     

    Hope this helps

    Wednesday, September 5, 2007 4:11 AM
    Moderator
  •  

    I was facing this same problem. But i got this issue when i converted my old VC6 project in VC2005. After conversion while compiling i was getting folloing

    Error    1    error C2259: 'ATL::CComObject<Base>' : cannot instantiate abstract class    XXXX 2005\vc\atlmfc\include\atlcom.h    1799  

     

    then i checked i was having few undefined exposed Functions in IDL. when i cleared them my project started compiling successfully

     

    Virat

    Wednesday, April 9, 2008 4:16 AM
  • Same problem (implementation of a Shell Extension - IContextMenu).

     

    FIXED by updating GetCommandString signature to

     

    GetCommandString ( UINT_PTR idCmd, UINT uFlags, UINT* pwReserved, LPSTR pszName, UINT cchMax )

     

    was:

     

    GetCommandString ( UINT, UINT, UINT*, LPSTR, UINT )

                                 ^^^^^^^^^^

     

    Alessio

     

    Friday, August 1, 2008 10:34 AM
  • Thanks -  updating GetCommandString worked for me - though I was only seeing the problem in my x64 build. 
    Change the GetCommandString signatuer (and implementation) form  
    STDMETHODIMP GetCommandString(UINT, UINT, UINT*, LPSTR, UINT);
    to
    STDMETHODIMP GetCommandString(UINT_PTR, UINT, UINT*, LPSTR, UINT);
    / Klaus Bjørn Jensen
    Tuesday, November 18, 2008 2:44 PM
  • And does this code work? I mean is your GetCommandString function called when the user puts mouse over your menu item?
    I'm asking because in my 64-bit build this function is never called in my shell extension and I don't know why :-(
    Thursday, January 8, 2009 12:31 PM
  • For x64, go to Project->Properties (or Alt+F7), then Configuration Properties-> Linker -> Advanced
    On the right side, go to "Target Machine", change this to "MachineX64 (/MACHINE:X64)
    ReBuild.

    In your target machine, regsvr32 YourDll,

    It should work now.

    Tuesday, April 14, 2009 7:31 AM
  • I met the same issue today.
    Then I compile the idl first, then compile the whole project again, it works. I guess the reason is the tlb file is screwed up somehow, and compile the idl explicitly re-generated the correct tlb file.

    Hope this helps
    Thursday, June 18, 2009 11:32 PM
  • Better late then never :) However it doesn't work. There is such option in IDE, indeed, but when I try to build such project, I get the following error message:

    1>LINK : warning LNK4012: invalid value 'X64', must be 'AM33, AMD64, ARM, CEE, EBC, IA64, M32R, MIPS, MIPS16, MIPSFPU, MIPSFPU16, MIPSR41XX, SH4, SH5, THUMB, or X86'; option ignored
    • Proposed as answer by Dominic Louis Tuesday, August 4, 2009 7:03 AM
    Friday, June 19, 2009 8:55 AM
  • It works fine,
    thanks
    JPH
    Wednesday, November 25, 2009 12:47 PM
  • How to fix the problem.

    I faced the same problem,

    Please paste the code,thanks.

    Tuesday, September 21, 2010 6:34 AM