#704 Heat throws "Bad Image" error on typelibs.

Rob Mensching
heat (135)
Anthony Valente

Not sure why but all the TLB files (created
internally) which are harvested by heat all throw
a "Bad Image" error.

Version: 3.0.2218.0


  • Bad Image screenshot

  • One of the offending files

  • Mike Dimmick
    Mike Dimmick

    Logged In: YES

    Check the tool you're generating the type libraries with. I get a
    TYPE_E_CANTLOADLIBRARY error when trying to open the attached type library with
    oleview.exe (from the Platform SDK/VS2005). The problem seems to be in the coclass.

    If that tool cannot open it, it's very likely malformed.

  • Logged In: YES
    Originator: YES

    Thanks Mike. The file was created with VB6. I can open the file happily with my copy of oleview (v2.10.054)

  • Jeff Skaistis
    Jeff Skaistis

    Logged In: YES
    Originator: NO

    I have the same problem with a type library generated with MIDL. From checking the source, the problem is coming from the native LoadLibraryEx call. LoadLibrary(Ex) will display an error message box whenever you attempt to load a non-DLL image file. Since the code in UtilHarvesterMutator attempts to load the file first as a regular DLL then as a TLB if that fails, you get the message box before it will continue successfully processing the TLB.

    Probably should add an explicit file extension check (.TLB) before running it through the DllHarvester.

  • This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 21 days (the time period specified by
    the administrator of this Tracker).