azsx wrote:
I don't understand your question. What is a "resource" and what
does it mean for it to contain an exe?
a resource is a Visual C++ concept. It hold some data like bitmaps,
menus, dialog boxes.
The only way to execute a separate program in ISO standard C++ is
through the system() function. There are other well-known extensions
that provide more capability, but you'll have to explore those
elsewhere.
Can I execute a program inside another program, like a thread or
function?
The only way to execute another program is via system(). When system()
is called (it's obviously a function), a text string is passed to the
command processor of the operating system, it one exists. This is from
the C (draft) standard, I don't believe C++ has any additional
requirements, other than the usual bit with headers and namespaces.
7.20.4.5 The system function
Synopsis
[#1]
#include <stdlib.h>
int system(const char *string);
Description
[#2] If string is a null pointer, the system function
determines whether the host environment has a command
processor. If string is not a null pointer, the system
function passes the string pointed to by string to that
command processor to be executed in a manner which the
implementation shall document; this might then cause the
program calling system to behave in a non-conforming manner
or to terminate.
Returns
[#3] If the argument is a null pointer, the system function
returns nonzero only if a command processor is available.
If the argument is not a null pointer, and the system
function does return, it returns an implementation-defined
value.
Standard C++ doesn't know about threads (at least yet, I don't what the
plans are for the future). When system() works at all, the calling
program stops until the system() function returns.
What determines when system() returns is implementation specific. For
instance, if you were to issue a command that requests the external
program run in the background, by whatever means the platform provides,
then system() might return and execution continue while the external
program runs in parallel. I've done that on UNIX, whether you could do
anything like that for Windows is something you'll have to explore
elsewhere.
Brian