Mega Code Archive

 
Categories / Delphi / Graphic
 

Failed to read Imagelist data from stream. Updated

Title: failed to read Imagelist data from stream. Updated. Question: Exception EreadError in Module {RB2K4} at {00023B03} Error reading {Inormal16.Bitmap}: failed to read Imagelist data from stream. Answer: If you use a toolbar with an imagelist or an imagelist elsewhere you could be in for an unpleasant surprise. After compiling and run or directly via the Run command you could receive the errormessage: Exception EreadError in Module {RB2K4} at {00023B03} Error reading {Inormal16.Bitmap}: failed to read Imagelist data from stream. The text {..} is depending on your project. Repeatingly closing down Delphi and trying again to compile and run your application will generally be successful. Nevertheless a pain in the back The problem is the compatibility of the different COMCTL32.DLL versions. Updating XP with SP2 made for me the problem far worse. For details see article 321841 on MS Knowledge Base. MS states everywhere that the problem is solved in XP SP2, but forget it. As said in XP+SP2 the problem is really a pain somewhere... If you encounter this errormessage the solution is to recreate the immagelist. A second solution is to create a resource file for the bitmaps of the imagelist and load them in your application at runtime. That works and is maybe always the best approach to use imagelists Look at DK3 article 526 from Igor Siticov . I fear that - given the fact that the incompatibility was solved and re-emerged more than once - the problem will return with each update of MS Windows. Via the comments in article "Themed Delphi IDE" I found that the problem is for me was caused by a manifest in the Delphi6/bin directory. The manifest forces the use of the latest COMCTL32.DLL Without the manifest the previous version of COMCTL32.DLL is used. With the release of Delphi 6 Borland made somewhere a remark about the use of a manifest. After removing the manifest the problem disappeared. It seems that this article is of no importance after all, but that is not true. Some people need the use the latest COMCTL32.DLL and for that the manifest (e.g. for Theming). Regards Hans PIETERS