Monday 15 August 2011

delphi - How can I fix EInvalidOperation related to ImageList -


My application (write on Delphi 7) runs correctly on Windows XP SP3 but when I run it on Windows 7 The exception is if I try:

EInvalidOperation

with the message "invalid imagelist" is the main application code:

  Application.Initialize; TmpSplash.GoNextMsg; Application Buyerform (TDMIZ, DMIJZ); TmpSplash.GoNextMsg; // Class Database Database APC. Creteform (TDM Charger, DM Churcher); TmpSplash.GoNextMsg; // Caracento Imgini App Cretform (TFRMN, framen); TmpSplash.GoNextMsg; // init: Anagram graphic frame anagram: = TeframeAnagraphica Composition (application); TmpSplash.GoNextMsg; // init: flota frame flatta: = tfremflota.create (app); // application. CreateForm (Trouframflata, Frame Flat); ... ...   

The module dmImages have been created correctly, such as frMain, but when the object frame Anagrafica will be created then the exception is increased on the manufacturer's method:

  Type TframeAnagrafica = Class (TMyCustomFrame) ... ... {$ R * .dfm} Constructor TframeAnagrafica.Create (AOwner: TComponent); Start inheriting (AoONar); End;   

and "super-class" of TframeAnagrafica:

  TMyCustomFrame = class (TFrame) ... ... {$ R *. Dfm} manufacturer TMyCustomFrame.Create (AOwner: TComponent); Start inheriting (AoONar); & Lt; - Exception ends here;   

There is no problem with Windows XP, but using Windows 7 comes a problem. How can I solve this problem? An exception can arise if you use the value for the property,

is not supported by the current operating system or if you try to use a 32bit imagelist with alpha channel ( TColorDepth.cd32bit ), but you have an XP manifest application is not. To do this, include the unit xpman in your project or "runtime theme" at Delphi XE2 or higher in "Projects" option> Application => Appearance> Runtime Themes " Enable ".

No comments:

Post a Comment