CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Oct 2003
    Posts
    204

    how to run other softwares?

    hi gurus,
    i don't know if this is the right forum...
    i want to make a visual c ++ application that recives input , then opens matlab(if not opened) run an m file there and then open 3ds max (if not opend)and run a script there.
    i have absolutely no idea how to do it .
    a general answer on hoe to run other softwares is also good
    thanks

  2. #2
    Join Date
    May 2004
    Location
    Germany
    Posts
    655
    you can use CreateProcess
    look in the msdn for further details

    example to start the explorer:
    Code:
    	STARTUPINFO si;
    	PROCESS_INFORMATION pi;
    
    	ZeroMemory( &si, sizeof(si) );
    	si.cb = sizeof(si);
    	ZeroMemory( &pi, sizeof(pi) );
    
    	
    	CreateProcess(NULL, "explorer.exe", NULL,NULL,FALSE,0,NULL,NULL,&si,&pi);

  3. #3
    Join Date
    Feb 2004
    Posts
    82
    If you don't want to run other applications as your sub-process, you can also use ShellExecute.

  4. #4
    Join Date
    Oct 2003
    Posts
    204
    thanks.

    ok but can i run something in the proccess i opened through the c++ app?
    in bigBA's example perform a search for a file (for example)

  5. #5
    Join Date
    May 2004
    Location
    Germany
    Posts
    655
    hm.. you can pass parameters to the app...

  6. #6
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652
    Take a look at the following FAQ...

  7. #7
    Join Date
    Oct 2003
    Posts
    204
    ok , i can open a proccess allright but i cant do the next step.
    for example in 3ds max , after the proccess is opened i want to
    do : Maxscripts->run scrips->somescript
    i do NOT want to open a file using a proccess (like open notepad.exe with sometxt.txt)
    how do i manipulate the proccess after i open it ?

    thank you !

  8. #8
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652
    Originally posted by urika
    how do i manipulate the proccess after i open it ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured