Updating a RT_HTML resource

delphi package - madRes, madTools, madStrings, ...
Post Reply
maxn
Posts: 1
Joined: Tue Oct 12, 2004 8:49 am

Updating a RT_HTML resource

Post by maxn »

I'm trying to update the RT_HTML resource using the functions below:

function MAKELANGID(sPrimaryLanguage : Word;
sSubLanguage : Word) : Word;
begin
result := (sSubLanguage shl 10) or
sPrimaryLanguage;

end;

procedure TForm1.Button1Click(Sender: TObject);
var
update : dword;
S : String;

begin
update := BeginUpdateResourceW('c:\shdoclc.dll', true);
if update <> 0 then
try
UpdateResourceW( update, {RT_HTML} MAKEINTRESOURCEW(23),
'about.dlg',
MAKELANGID(SUBLANG_NEUTRAL,SUBLANG_DEFAULT ),
pointer(S),Length(S) + 1);
finally
EndUpdateResourceW(update, false);
end;
end;


However I get the resource section corrupted.

Please help!
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Are you using the newest version of madCollection? You do have added madRes to your unit's uses clause, don't you?

If you can answer both question with "yes", then please send me a little demo with which I can reproduce the problem on my PC. Thanks...
Post Reply