I wish to embed an existing executable file within my executable and execute it. I am using Visual C++. Is there a way to do this ? Any reference or idea will be greatly appreciated. Thanks

9 Years
Discussion Span
Last Post by Salem

There's an easy way, yes. Why would you want to?

I have a bunch of kids small games. I wish to present them through my application.


There are some legitimate reasons to do such a thing. I've done something similar before so that I could keep the two files together without resorting to writing an installation program.

I think there are at least two choices:

1) compile it as a resource in the resource file.

2) just append it to the end of the executable and extract it yourself whenever you want to. First get the size of the program without the attachment, attach the file, then append another line that is the size of the original program. After than, in the original program add some code that extracts the appended file.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.