What I need to do is add a resource to a exe file. For example, with programs like ResHacker you can do it. I was wondering if it can be done in VB6. If no one knows, then I will just have to use ResHacker via command line.
Thanks.
Printable View
What I need to do is add a resource to a exe file. For example, with programs like ResHacker you can do it. I was wondering if it can be done in VB6. If no one knows, then I will just have to use ResHacker via command line.
Thanks.
VB6 has its own Resource Editor - go to Add-Ins menu, select Add-Ins Manger and make sure that "Resource Editor" is loaded and started.
One you did that you can go to Project menu and select "Add New Resource File".
When you compile your project resource file will be compiled directly into exe.
I know how to do that, what I need to do is add a resource file to an already compile file. For example, imagine you have a random exe file not made in visual basic. And I want to add a resource file to it. Thats what I need to do.
No I don't think you can unless you recompile the exe.Quote:
Originally Posted by The Rogue
You can add any type of file to a Resource file and extract that file to where ever you want to when your app runs. If you wanted to add ResHacker to your exe then that isn't a problem. When you app runs you could extract ResHacker to your App.Path and Shell it from there. But don't forget, anything you add to a Resource file increases the compiled exe size by the same amount. ;)Quote:
Originally Posted by The Rogue
You can use UpdateResource Function to do this, though its applications are fairly narrow.
Normally this is used to embed manifests, replace embedded Help text, update localization string tables, etc. It is rare for this to be useful though, and generally recompiling makes the most sense. If the program isn't already aware of the resource adding it doesn't accomplish much.
Thanks you, do you know how it works? I want to add a text file as the resource type "RCDATA" and the name "Settings". Would you know how to do that?Quote:
Originally Posted by dilettante
Here is my current code, this is just to test:
But, when I put in ResHacker, the resource data shows up as "ó••"Code:Dim FileHandle As Long
Dim ResData As String
ResData = "test data"
FileHandle = BeginUpdateResource("C:\Copy of test.exe", False)
Call UpdateResource(FileHandle, "RCDATA", "test", 0, VarPtr(ResData), Len(ResData))
Call EndUpdateResource(FileHandle, 0)
Anyone know why?