【发布时间】:2013-12-29 09:51:59
【问题描述】:
我正在为this question 做一些跑腿工作,特别是针对以下句子:
我什至无法从 IOTAProject 获得这个接口。
再次我的意思是 Delphi 2005 和 2006 outlined by Erik Berry 中存在的众所周知的缺陷。请访问链接的 QC 条目以获取完整的测试用例。
字数不多,这是我的代码:
procedure TResDumpWizard.Execute;
var
Project: IOTAProject;
Resource: IOTAProjectResource;
I: Integer;
Entry: IOTAResourceEntry;
begin
Project := (BorlandIDEServices as IOTAModuleServices).GetActiveProject;
Assert(Assigned(Project), 'No active project');
Resource := nil;
for I := 0 to Project.ModuleFileCount - 1 do
begin
if Supports(Project.ModuleFileEditors[I], IOTAProjectResource, Resource) then
Break;
end;
Assert(Assigned(Resource), 'No resources in project'); // (!!!) always fails
for I := 0 to Resource.GetEntryCount - 1 do
begin
Entry := Resource.GetEntry(I);
(BorlandIDEServices as IOTAMessageServices).AddTitleMessage(DisplayName(Entry.GetResourceName));
end;
end;
循环遍历项目的模块文件编辑器永远不会找到任何资源,即使项目有额外的资源
- 通过资源和图像对话框添加
- 使用
{$RESOURCE binary.res}指令 -
使用不再有效{$R filename.res filename.rc}语法
【问题讨论】:
标签: delphi delphi-xe2 toolsapi