473,396 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Resource question

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?

Oct 30 '06 #1
5 1614

azsx schrieb:
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

Oct 30 '06 #2
azsx wrote:
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
Oct 30 '06 #3
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?

Oct 30 '06 #4
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
Oct 30 '06 #5
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.
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.

>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?
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-lit...t.html#faq-5.9
Oct 30 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: John Perks and Sarah Mount | last post by:
When handling resources in Python, where the scope of the resource is known, there seem to be two schools of thought: (1) Explicit: f = open(fname) try: # ... finally: f.close()
8
by: Bonj | last post by:
when creating a resource-only dll, the only way I can get it to compile and work correctly, is to make it a non-resource-only dll. surely this can't be the way...? basically, there is a load of...
2
by: Joe Thompson | last post by:
Hi, I am trying to use PlaySound in a VC++.net Windows app (VS 2003). I can use it to play a file but now I want to play it from a resource. I have two questions: How do I add a wav file to...
3
by: Kelmen Wong | last post by:
I'm having a real hard-time to work out the hell of the statelite assembly. 1) At start, the official MSDN stated to use: .... new ResourceManager(strBaseName,...
1
by: mehdi_mousavi | last post by:
Hi folks, Consider a string that's defined under VS2005 resource editor as myField with the value of myValue. To access the value, I could easily use the Properties.Resources class, for example:...
1
by: John | last post by:
Can some one please help me with this code? I've spend 2 days on it. And I see the question all over the place but I do not see the answer. No on is answering the question I am about to ask. I...
8
by: CodeLeon | last post by:
Hi, All. I am creating a setup program. The way it works is that the user creates their setup info, my program generates the C# code for a setup executable, embeds the xml file containing the info...
7
by: craig | last post by:
....quick question for anyone who might have some experience with .net resource files in VS 2003. I have an application that is not localized, but I would still like to be able to place all of...
12
by: TS | last post by:
i have a need to possibly enable mutli language support. What benefit do i get by using a resource file instead of a custom xml solution? thanks!
0
by: =?Utf-8?B?UGF1bCBIYWdlcg==?= | last post by:
I've been trying to solve this issue for the better part of a month. My attempts to get an answer on the MSDN groups proved to no avail. Here is the situation/problem. I am migrating an old...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.