upd := BeginUpdateResourceW(PWideChar(WideString(f)), false);
if upd <> 0 then
begin
if UpdateResourceW(upd, MAKEINTRESOURCEW(24), MAKEINTRESOURCEW(1), 0, Res.Memory, Res.Size) then
Items[i].SubItems[0] := XP else Items[i].SubItems[0] := ERR;
EndUpdateResource(upd, false);
end;
but I step into an Access Violation in UpdateResourceW:
I'm glad you got the problem solved with Colin's stuff. Still I'd like to find out why madRes failed for you. Would you mind sending me a little demo project which reproduces the problem? Or would you at least send me one of the exes you tried to modified together with the manifest you tried to add?
Would you mind sending me a little demo project which reproduces the problem?
I'm really sorry but I deleted my MadRes project, I kept only the working one. Anyway I tried with a standard Manifest (it works smoothly using Colin's units) and my code is showed by the original post.
Just tried to reproduce it, but I can't. It works just fine for me. The exception location very strongly indicates that the "upd" handle you gave into UpdateResourceW was not what madRes expected. I can only understand that if for whatever reason you used Windows.BeginUpdateResourceW together with madRes.UpdateResourceW.
Anyway, don't worry, just forget it. I simply wanted to put a last message into this thread in case somebody runs into a similar problem.