Resource question

A

azsx

Hi! I use C++ with Visual Studio 2005. Let's suppose I create a
resource that holds an exe file in my programm. How can I execute this
exe file in my resource from my programm?
 
R

ralph

azsx said:
Hi! I use C++ with Visual Studio 2005. Let's suppose I create a
resource that holds an exe file in my programm. How can I execute this
exe file in my resource from my programm?

resource? exe file?

This is a group about standard C++. I think you're better off asking
your question in a group related to your specific compiler.

ralph
 
D

Default User

azsx said:
Hi! I use C++ with Visual Studio 2005. Let's suppose I create a
resource that holds an exe file in my programm. How can I execute
this exe file in my resource from my programm?


I don't understand your question. What is a "resource" and what does it
mean for it to contain an exe?

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.





Brian
 
A

azsx

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?
 
D

Default User

azsx said:
a resource is a Visual C++ concept. It hold some data like bitmaps,
menus, dialog boxes.

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
 
R

red floyd

azsx said:
a resource is a Visual C++ concept. It hold some data like bitmaps,
menus, dialog boxes.

We knew that. The point of the question was to make it clear that it's
outside the scope of this newsgroup, which is Standard C++ only. The
ISO Standard (ISO/IEC 14882:2003) does not mention such things as
"resources" or "exe" files.

Can I execute a program inside another program, like a thread or
function?

To repeat Default User's answer: 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.

And to answer both questions:

http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.9
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top