Resource question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • azsx

    #1

    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?

  • ralph

    #2
    Re: Resource question


    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

    Comment

    • Default User

      #3
      Re: Resource question

      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

      Comment

      • azsx

        #4
        Re: Resource question

        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?

        Comment

        • Default User

          #5
          Re: Resource question

          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

          Comment

          • red floyd

            #6
            Re: Resource question

            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:




            Comment

            Working...