Click here to Skip to main content
16,004,686 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Implementation Magnetic effect to ControlBar Pin
Cristi Posea26-May-00 19:12
Cristi Posea26-May-00 19:12 
GeneralDos command from mfc app Pin
Tim Hodgson24-May-00 11:48
Tim Hodgson24-May-00 11:48 
GeneralRe: Dos command from mfc app Pin
imsniper24-May-00 21:06
imsniper24-May-00 21:06 
GeneralRe: Dos command from mfc app Pin
Tim Hodgson25-May-00 3:34
Tim Hodgson25-May-00 3:34 
GeneralRe: Dos command from mfc app Pin
Peter Zajac25-May-00 4:41
Peter Zajac25-May-00 4:41 
GeneralRe: Dos command from mfc app Pin
Tim Hodgson25-May-00 7:07
Tim Hodgson25-May-00 7:07 
GeneralRe: Dos command from mfc app Pin
Konstantin Vasserman25-May-00 12:15
Konstantin Vasserman25-May-00 12:15 
GeneralRe: Dos command from mfc app Pin
Tim Deveaux25-May-00 13:46
Tim Deveaux25-May-00 13:46 
void CTestDirDlg::OnButton1() 
{
    // TODO: Add your control notification handler code here

    STARTUPINFO             startInfo;
    PROCESS_INFORMATION     procInfo;

    startInfo.cb = sizeof(STARTUPINFO);
    startInfo.lpReserved = NULL;
    startInfo.lpTitle = NULL;
    startInfo.lpDesktop = NULL;
    startInfo.dwX = startInfo.dwY = startInfo.dwYSize = startInfo.dwXSize = 0;

    // the interesting stuff!
    startInfo.dwFlags = STARTF_USESHOWWINDOW;
    startInfo.hStdInput   = NULL;
    startInfo.hStdOutput  = NULL;
    startInfo.hStdError   = NULL;

    startInfo.wShowWindow = SW_SHOW;
    startInfo.lpReserved2 = NULL;
    startInfo.cbReserved2 = NULL;


    // Create the process...
    if (!CreateProcess (    NULL,   // app name
                            "c:\\command.com /k dir",                                
                            NULL,   // proc sec attr
                            NULL,   // thread sec attr
                            FALSE,   // inherit handles
                            NORMAL_PRIORITY_CLASS,  // creation flags omitted
                            NULL,   // p 2 new env block
                            NULL,   // current dir name
                            &startInfo,   // our startup info
                            &procInfo     // info returned for proc
                            ))
    {
        int err = GetLastError();
        // etc...
    }

    
}

You can play with this a bit - the next thing to add is
the mechanism for passing the stdin, out, and error handles so that you can get the results...
GeneralRe: Dos command from mfc app Pin
Mike Dunn25-May-00 16:42
Mike Dunn25-May-00 16:42 
GeneralFrom Visual C++ to Borland C++ Pin
James Khan24-May-00 9:10
James Khan24-May-00 9:10 
GeneralRe: From Visual C++ to Borland C++ Pin
Tim Deveaux24-May-00 14:05
Tim Deveaux24-May-00 14:05 
GeneralBorland C++ sites like code tools Pin
James Khan24-May-00 9:04
James Khan24-May-00 9:04 
GeneralRe: Borland C++ sites like code tools Pin
Arvind2324-May-00 13:55
Arvind2324-May-00 13:55 
GeneralRe: Borland C++ sites like code tools Pin
Chris Maunder29-May-00 17:39
cofounderChris Maunder29-May-00 17:39 
GeneralViewing include file dependency tree Pin
Philip Winston24-May-00 8:58
Philip Winston24-May-00 8:58 
GeneralRe: Viewing include file dependency tree Pin
Tim Deveaux25-May-00 14:48
Tim Deveaux25-May-00 14:48 
GeneralRe: Viewing include file dependency tree Pin
Philip Winston26-May-00 5:25
Philip Winston26-May-00 5:25 
QuestionHow to create Web Search Assistant of IE 5.0? Pin
mahesh24-May-00 8:00
mahesh24-May-00 8:00 
AnswerRe: How to create Web Search Assistant of IE 5.0? Pin
Erik Thompson31-May-00 7:41
sitebuilderErik Thompson31-May-00 7:41 
QuestionPlease Help! Open a menu programmatically? Pin
Jim Steele24-May-00 5:25
Jim Steele24-May-00 5:25 
AnswerRe: Please Help! Open a menu programmatically? Pin
Dmitriy25-May-00 9:33
Dmitriy25-May-00 9:33 
AnswerRe: Please Help! Open a menu programmatically? Pin
kasreng26-May-00 7:04
kasreng26-May-00 7:04 
GeneralCListCtrl Bug Pin
Ingo Eberhardt24-May-00 0:31
sussIngo Eberhardt24-May-00 0:31 
GeneralHttpSendRquest and HttpSendRequentex Pin
zlyang23-May-00 23:50
zlyang23-May-00 23:50 
GeneralFTP Client Pin
beretta23-May-00 13:24
beretta23-May-00 13:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.