【发布时间】:2013-06-21 17:29:08
【问题描述】:
我的应用程序(在 Delphi 7 上编写)在 Windows XP SP3 上正常运行,但是当我尝试在 Windows 7 上运行它时出现此异常:
EInvalidOperation 带有消息“Invalid ImageList”
这是主要的应用程序代码:
Application.Initialize;
tmpSplash.GoNextMsg;
Application.CreateForm(TdmImages, dmImages);
tmpSplash.GoNextMsg; // Collegamento database
Application.CreateForm(TdmCharter, dmCharter);
tmpSplash.GoNextMsg; // Caricamento immagini
Application.CreateForm(TfrMain, frMain);
tmpSplash.GoNextMsg; // init: Anagrafica
frameAnagrafica := TframeAnagrafica.Create(Application);
tmpSplash.GoNextMsg; // init: Flotta
frameFlotta := TframeFlotta.Create(Application);
//Application.CreateForm(TframeFlotta, frameFlotta);
...
...
模块 dmImages 已经正确创建,例如 frMain,但是当 将创建对象 frameAnagrafica 然后在构造函数方法上引发异常:
type
TframeAnagrafica = class(TMyCustomFrame)
...
...
{$R *.dfm}
constructor TframeAnagrafica.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
end;
还有 TframeAnagrafica 的“超类”:
TMyCustomFrame = class(TFrame)
...
...
{$R *.dfm}
constructor TMyCustomFrame.Create(AOwner: TComponent);
begin
inherited Create(AOwner); <-- Exception here
end;
在windows XP下没问题,但是用windows 7就出问题了。 我该如何解决这个问题?
【问题讨论】:
-
也许你可以展示一些你的代码。否则,我们的帮助希望破灭。
-
什么版本的Delphi?图像列表中有哪些类型的图像?它们是如何加载到图像列表中的?如果您希望我们为您提供帮助,您需要具体并提供详细信息。我们无法从这里看到您的代码、读懂您的想法或访问您的机器来为您调试它,因此我们所能做的就是使用您提供给我们的信息来提供帮助。请edit您的问题并提供更多信息。谢谢。
-
你在问我们什么?
-
应用程序清单可能有问题。
-
我注意到您编辑了问题。你这样做很好,但在你提供一些真实信息之前你不会得到任何帮助。解决问题不是靠魔术发生的。收集信息和证据。然后可以制定解决方案。你需要做得更好。
标签: delphi delphi-7 timagelist