Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 678039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:06:19+00:00 2026-05-14T01:06:19+00:00

Is there a way to link an existing .exe file with other C++ source

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T01:06:20+00:00Added an answer on May 14, 2026 at 1:06 am

    CreateProcess() is a Windows API call to start a process, exactly as it sounds like, as a child of your program that you can control by knowing it’s HANDLE. system() executes a system command. That’s as much as you’ll ever know and I personally avoid using it at all costs – not least because it isn’t portable (the function exists on windows and linux but the command won’t).

    It is possible to append the data to the end of an EXE image – this is how installers work. Have a look at this microsoft support article, which bizarrely gives you code in basic but you should be able to turn it into C++ trivially. Here’s an article on creating a self-extractor which might be more suitable. Both should allow you to embed files in the exe.

    I don’t recommend you extract 7za and call it from System() or CreateProcess() – I recommend you learn the SDK. It is difficult, but you’ll learn a lot from doing it.

    Finally, as you’ll have to modify an existing exe file you won’t be able to do this at compile-time. You’ll need to have the code add whatever to its own image or another image.

    More detail on addressing data appended to an exe.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can link the results of an existing table/view to an Excel spreadsheet (by
Hi there I would like to allow an existing JFrame (Calculating application) to print
Is there any way to get just a part from MySql cell and ignore
I have a link. I have checked that the link is a valid URL
I'm aware there are dozens of questions about this and blog after blog post
I want to generate a link on my page where a key/value pair is
I'm writing an application in C that can be extended at runtime by means
I'm using EpiServer CMS 5R2 on a new project. I've been tasked with creating
We recently moved our database from our SQL Server 2005 server to our SQL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.