SolvedAdding File In Resources At Runtime

Posts 1–6 of 6 · Page 1 of 1
Adding File In Resources At Runtime
Hello MPGH coders...

I made a project and i added open file dialog and i want the chosen file from open file dialog to be added to my resource as a Dll......:
Can i do that?
I've been looking as well for a while for my idea of a file vault, i didn't manage to find much. but a few threads and websites mentioned something like "use resourcewriter" and stuff, but i don't know
Quote Originally Posted by Raow View Post
I've been looking as well for a while for my idea of a file vault, i didn't manage to find much. but a few threads and websites mentioned something like "use resourcewriter" and stuff, but i don't know
Iam gonna to be crazy about it..
You can't. Resources are are compile-time data store. Their size, location and type are all laid out in the PE structure of the file. You can't just dynamically add on anything you want.

You could write a really ugly "possible" solution involving manual PE walking and allocating an arbitrarily large resource at compile time, then overwriting it with data as you go, but that would be patchy at best, and would probably cause more problems than it would solve.

The next big problem is that any writing you do to the program will have to be done while the program is not running. Meaning if you were to write the contents of a file into your exe, you'd need to write a batch script or something to execute when the program closes.

In reality, this isn't going to work. From your description of what you want, it doesn't even sound overly useful: Why do you want to add the .dlls to your resources?
then i can't..if so @Hassan req to close plz if u want
Yeah you can't do that.

Closed on request.
Posts 1–6 of 6 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us