Embedding an existing exe file into another program

Posted by Milad on Stack Overflow See other posts from Stack Overflow or by Milad
Published on 2010-03-22T23:46:16Z Indexed on 2010/03/23 0:01 UTC
Read the original article Hit count: 334

Filed under:
|
|

Is there a way to link an existing .exe file with other C++ source files during compilation? What I'm actually trying to do is to compress and decompress some files in my console program using LZMA(7zip) SDK but unfortunately it's very difficult to use for a newbie.

There is a command line version of LZMA called 7za.exe and I am wondering if I can somehow embed it into my program and use it like a function. It can be easily used with system() function (which seems to be a very dangerous thing to use) but then if I send my program to someone who doesn't have 7za.exe in the right folder it won't work.

I came across CreateProcess() function in windows.h header files but it seems to achieve what system() does in a more proper and advanced way. I don't know if it can actually link the exe file like an object file during compilation

© Stack Overflow or respective owner

Related posts about exe

Related posts about createprocess