I am getting an odd exception:

I am getting an odd exception:

Cannot create WIC Imaging Factory object for 'TCustomBitmapCodecWIC'.

This is occuring on Windows 2003 server with code that is built with 10-Seattle and seems to run perfectly fine everywhere else. Nothing weird... In a nutshell, I'm just trying to load the application's icon from the exe to an image on the application's splash screen. This is what it is running and it is choking on the Bitmap.LoadFromStream() call:

var
icon: TIcon;
Stream: TMemoryStream;

begin
icon := TIcon.Create;
icon.LoadFromResourceName(HInstance, 'MAINICON');
if icon.Handle = 0 then
begin
Exit;
end;

Stream := TMemoryStream.Create;
icon.SaveToStream(Stream);
Stream.Position := 0;
imgAbout.Bitmap.LoadFromStream(Stream);
icon.Free;
Stream.Free;
end;

Comments

  1. Uwe Raabe​ thanks. Since I'm not explicitly using this at all, does this mean that my application is not compatible with Windows versions prior to 2008?! This is our first FireMonkey project...

    ReplyDelete
  2. Update: This same application works fine in XP?!

    ReplyDelete
  3. The MSDN link above mentions XP as supporting that interface, too. The fact that XP isn't supported by Seattle doesn't mean that it cannot run under XP. If you have to target FMX on Windows Server 2003 you are probably out of luck. Even XE2 requires that interface.

    ReplyDelete

Post a Comment