execut

I want to execut another program ( exe file )
from my program ( cpp )
what is the statment , is there anything more I have to add it to my program ( cpp ) like include ----
please give me an example
thanks

Comments

  • : I want to execut another program ( exe file )
    : from my program ( cpp )
    : what is the statment , is there anything more I have to add it to my program ( cpp ) like include ----
    : please give me an example
    : thanks
    :
    A good example can be found in the "C++ Builder How-To" book written by John Miano.... I use:

    void TMainForm::RunProgram(void)
    {
    HWND handle;
    ShellExecute(handle, "open", "Program_Name.exe", NULL, NULL, SW_SHOWNORMAL);
    }

    Hope this helps, Dwight


  • that example not working
    giving this error:
    [C++ Error] Project11.cpp(11): E2090 Qualifier 'TMainForm' is not a class or namespace name
    but this is working:
    HINSTANCE hInst=ShellExecute(0,"open","c:\exe para","c:\exe prog",0,SW_SHOW);

  • : that example not working
    : giving this error:
    : [C++ Error] Project11.cpp(11): E2090 Qualifier 'TMainForm' is not a class or namespace name
    : but this is working:
    : HINSTANCE hInst=ShellExecute(0,"open","c:\exe para","c:\exe prog",0,SW_SHOW);
    :
    :

    It's not working because you copied whole function into your own...
  • : : that example not working
    : : giving this error:
    : : [C++ Error] Project11.cpp(11): E2090 Qualifier 'TMainForm' is not a class or namespace name
    : : but this is working:
    : : HINSTANCE hInst=ShellExecute(0,"open","c:\exe para","c:\exe prog",0,SW_SHOW);
    : :
    : :
    :
    : It's not working because you copied whole function into your own...
    :
    VampireFE is right, I copied the code out of one of my functions. You need to make it your own. It looks you have it working, good luck.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories