开发者

Using UpdateResource() to update one's own resources

I have an application whose re开发者_Go百科sources need to be updated externally from time to time. I want the application to update it's own resources.

The problem with UpdateResource() is that it cannot be used on a currently executing process. Any ideas how I can update resources from the application itself instead of writing an external app to handle this?

regards, andy


This seems to be not a good solution to update the application resources. Programs are installed with Administrator rights. A standard user has no write access to the program executable files. Consider saving the data you need in a user directory. E.g. %LOCALAPPDATA%. If you really need resources you can also put a resource-only DLL there. Then it is easy to update even in a multi-user scenario.


You should move the resources to an external DLL and unload it while updating and reload it back.


You can't modify your own executable.

Also, you must not do this. What if you're running from read-only drive?

For storing program state, there is %APPDATA%, %LOCALAPPDATA% and registry.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜