title: UpdateResource fails...what i am doing wrong?
body: <p>I am trying to update a bitmap inside an exe. I opened resource hacker and saw that the resource name is 6801 so i came up with this code </p>
  
  <pre><code>ResUpdate:=BeginUpdateResource(Pchar(szExplorer),false);
  ShowMessage(SysErrorMessage(GetLastError));
  if ResUpdate&lt;&gt;0 then
  begin
    FS:=TFileStream.Create(szBitmap,fmOpenRead or fmShareDenyWrite);
    SetLength(thebmp,FS.Size);
    dwSize:=FS.Size;
    FS.ReadBuffer(thebmp[0],FS.Size);
    FS.Free;
    UpdateResource(ResUpdate,RT_BITMAP,MAKEINTRESOURCE(6801),LANG_SYSTEM_DEFAULT,@thebmp[0],dwSize);
    EndUpdateResource(ResUpdate,false);
  end;
  </code></pre>
  
  <p>The call to UpdateResource fails. Where am i wrong ?</p>