Click here to Skip to main content
15,913,487 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: append data to file Pin
Michael Dunn24-Jun-04 6:57
sitebuilderMichael Dunn24-Jun-04 6:57 
GeneralRe: append data to file Pin
elephantstar24-Jun-04 6:56
elephantstar24-Jun-04 6:56 
GeneralDFS Lookups Pin
Anonymous23-Jun-04 13:45
Anonymous23-Jun-04 13:45 
GeneralRe: DFS Lookups Pin
NullStream23-Jun-04 13:47
NullStream23-Jun-04 13:47 
Generaleditable listctrl Pin
DanYELL23-Jun-04 13:08
DanYELL23-Jun-04 13:08 
GeneralRe: editable listctrl Pin
Anthony_Yio23-Jun-04 16:44
Anthony_Yio23-Jun-04 16:44 
QuestionA better System( ... ) call? Pin
mike-o23-Jun-04 12:37
mike-o23-Jun-04 12:37 
AnswerRe: A better System( ... ) call? Pin
Johan Rosengren23-Jun-04 21:32
Johan Rosengren23-Jun-04 21:32 
Here is an example nicked from MSDN:

#include <windows.h>
#include <stdio.h>
#define MAXNAMELEN    255
#define CMDLINE        "/c dir"
#define IMAGENAME      "\\nt\\bin\\cmd.exe"
#define WINTITLE       "CreateProcess DEMO"

main(){
BOOL    fSuccess,fExit;
DWORD    dwExitCode,dw;
STARTUPINFO    SI;
PROCESS_INFORMATION    pi;
HANDLE     hProcess,hThread;
SI.cb =sizeof(STARTUPINFO); SI.lpReserved = NULL;SI.lpDesktop=NULL;
SI.lpTitle="CreateProcess DEMO";SI.cbReserved2=0;SI.lpReserved2=NULL;
fSuccess = CreateProcess((LPTSTR)IMAGENAME, (LPTSTR)CMDLINE,
           (LPSECURITY_ATTRIBUTES)NULL, 
           (LPSECURITY_ATTRIBUTES)NULL,
           (BOOL)TRUE,(DWORD)0,NULL,NULL,
           (LPSTARTUPINFO)&SI,(LPPROCESS_INFORMATION)&pi); 
if (fSuccess) {  
    hProcess = pi.hProcess;    hThread = pi.hThread;
    printf("Process Id = %d\nThread Id = %d\n",pi.dwProcessId,pi.dwThreadId);
    dw = WaitForSingleObject(hProcess, INFINITE) ;
    if (dw != 0xFFFFFFFF) { /* if we saw success ... */
        /* pick up an exit code for the process */
        fExit = GetExitCodeProcess(hProcess, &dwExitCode) ;
    }
    /* close the process and thread object handles */
    CloseHandle(hThread) ;    CloseHandle(hProcess) ;
    printf("COMPLETED!\n");
}
else    printf("Failed to CreateProcess\n"); 

}


The same method can be used in a GUI-app as well.
GeneralRe: A better System( ... ) call? Pin
mike-o24-Jun-04 5:29
mike-o24-Jun-04 5:29 
GeneralInterpreting strings as packed binary data Pin
NizZy23-Jun-04 12:18
NizZy23-Jun-04 12:18 
GeneralRe: Interpreting strings as packed binary data Pin
NizZy23-Jun-04 12:28
NizZy23-Jun-04 12:28 
Generalnamed pipe problem Pin
pnpfriend23-Jun-04 11:20
pnpfriend23-Jun-04 11:20 
GeneralNeed Map to Database Ideas Pin
macbeth7623-Jun-04 10:20
macbeth7623-Jun-04 10:20 
GeneralRe: Need Map to Database Ideas Pin
Anthony_Yio23-Jun-04 16:38
Anthony_Yio23-Jun-04 16:38 
GeneralChanging fontcolor Pin
Wim Summer23-Jun-04 9:42
sussWim Summer23-Jun-04 9:42 
GeneralRe: Changing fontcolor Pin
bneacetp23-Jun-04 10:04
bneacetp23-Jun-04 10:04 
GeneralChanging the fontcolor. Pin
Wim Summer23-Jun-04 9:37
sussWim Summer23-Jun-04 9:37 
GeneralRe: Changing the fontcolor. Pin
User 58385223-Jun-04 19:11
User 58385223-Jun-04 19:11 
GeneralProblems with Bitmaps Pin
Member 114074823-Jun-04 9:29
Member 114074823-Jun-04 9:29 
GeneralRe: Problems with Bitmaps Pin
PJ Arends23-Jun-04 10:21
professionalPJ Arends23-Jun-04 10:21 
GeneralRe: Problems with Bitmaps Pin
Member 114074823-Jun-04 11:06
Member 114074823-Jun-04 11:06 
GeneralLPDISPATCH help me Pin
Nitro_gen23-Jun-04 9:16
Nitro_gen23-Jun-04 9:16 
GeneralRe: LPDISPATCH help me Pin
Anthony_Yio23-Jun-04 16:33
Anthony_Yio23-Jun-04 16:33 
GeneralSetting a Custom Background for the Main Menu Bar Pin
Steve Thresher23-Jun-04 9:13
Steve Thresher23-Jun-04 9:13 
GeneralWant help in learning Unicode Usage Pin
Member 119592223-Jun-04 8:53
Member 119592223-Jun-04 8:53 

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.