dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: error MIDL2020 : error generating type library : SaveAllChanges Failed

  1. #1
    Join Date
    Nov 2002
    Location
    India
    Posts
    60

    Unhappy error MIDL2020 : error generating type library : SaveAllChanges Failed

    when i am building a particular atl dll i am getting the followinf error message error MIDL2020 : error generating type library : SaveAllChanges Failed

  2. #2
    Join Date
    Mar 2000
    Location
    Birmingham, England
    Posts
    2,520
    Good for you !

    I expect you want to know what it means and what's causing it ? I had a look in MSDN for an explanation, but it doesn't give one

    As to what's causing it ? No idea without seeing your code. You may want to show us some if you need more help.

    Jase

    www.slideshowdesktop.com
    View your images and photos on your desktop with ease using SlideShow Desktop, the desktop wallpaper manager for Microsoft Windows.
    ...

  3. #3
    Join Date
    Mar 2000
    Location
    Birmingham, England
    Posts
    2,520
    I had another look and found this using Google :

    "MIDL2020: error generating type library
    The type library could not be generated. One possible cause of this error is specifying a path to the IDL file that is longer than 126 characters. Oleaut32.dll does not support path names longer than 126 characters. "

    Also, I found this, which may be helpful ?

    " ... In contrast, the COM map, used by ATL's implementation of QueryInterface, must contain an entry for each and every interface (except IUnknown). So our COM map changes from:

    BEGIN_COM_MAP(CMultiInterface)
    COM_INTERFACE_ENTRY(IFoo)
    COM_INTERFACE_ENTRY(IDispatch)
    END_COM_MAP()

    to:

    BEGIN_COM_MAP(CMultiInterface)
    COM_INTERFACE_ENTRY(IFoo)
    COM_INTERFACE_ENTRY(IFoo2)
    COM_INTERFACE_ENTRY(IGoo)
    COM_INTERFACE_ENTRY(IDispatch)
    END_COM_MAP()

    Class view will update as soon as we finish the COM map changes.

    Adding Methods
    Adding methods is the same as before with one gotcha: Visual Studio doesn't pay attention to the fact that IFoo2 is inherited from IFoo, so it will, by default, generate a dispatch ID of 1. You can change this as you declare the method by clicking the Attributes button in the wizard, or you can change the IDL by hand later. If you don't change it, you'll get the following incredibly helpful error message:

    midl\oleaut32.dll : error MIDL2020 : error generating type library :
    AddImplType failed : MultiInterface

    Nice, huh? As soon as you avoid ID collision by changing Func3's ID to something other than 1 or 2, the error will go away."

    Jase

    www.slideshowdesktop.com
    View your images and photos on your desktop with ease using SlideShow Desktop, the desktop wallpaper manager for Microsoft Windows.
    ...

  4. #4
    Join Date
    Dec 2006
    Posts
    1

    Re: error MIDL2020 : error generating type library : SaveAllChanges Failed

    Another good way to get this message is to have the .tlb file write-protected, as you do when you use a code management tool...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)