Hi,
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

Antibiotics anyone..... antibiotics?

commented: Hehe +14

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

Antibiotics only help against bacteria...

Antibiotics only help against bacteria...

Uh Oh.... then I guess we are in a world of hurt.

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.

So what's wrong with a simple menu program, and a sub-directory containing all the games?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.