You have two basic choices: either write your program in pure C++ (or some other language that can/will produce completely standalone executable files) or else use a dependency walker to find what DLLs are needed, and package them up into an installation program.
The option you're suggesting (taking an existing executable that depends on some DLLS, and trying to "inject" the DLLs into the executable) is pretty much unworkable. In theory, you could (for example) create an installation program as an executable and just have the user re-run the installation program every time they want to run your program. This will usually add enough overhead that your users probably won't like it.
Likewise, you could put the DLL in the executable as a binary resource and use FindResource
, LoadResource
, etc., to write its content out to a temporary file -- but this requires some semi-advanced programming, and it still imposes a fair amount of overhead.