Hi all,
we're trying to update the version info that is contained in a .res file from an external application. I've tried opening the .res file with BeginUpdateResource but this always gives 0 in return, indicating the file wasnt opened. Getlasterror gfives a 0 too!
What are we doing wrong?
Bascy
Software developer at
we're trying to update the version info that is contained in a .res file from an external application. I've tried opening the .res file with BeginUpdateResource but this always gives 0 in return, indicating the file wasnt opened. Getlasterror gfives a 0 too!
What are we doing wrong?
Code:
function UpdateResFile(const ResFile: Pchar; const arVersion: TByteArray):Boolean;
var
AHandle : THandle ;
KbCode : Longword;
Size1 , Size2 : DWORD;
Pt1:Pointer;
begin
Pt1 := Addr(arVersion);
KbCode := (SUBLANG_ENGLISH_US shl 10) or LANG_ENGLISH;
AHandle := BeginUpdateResource(ResFile , False);
if aHandle = 0 then
ShowMessage('Error: ' + IntToStr(GetLastError) )
else
begin
Windows.UpdateResource( AHandle , RT_VERSION , '',KBCode, Pt1 , Size1);
result := EndUpdateResource(AHandle , False);
end;
end;
Bascy
Software developer at