Click here to Skip to main content
15,887,915 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Window Resizing!? / Win32 Pin
Stephen Hewitt13-May-10 14:01
Stephen Hewitt13-May-10 14:01 
GeneralRe: Window Resizing!? / Win32 Pin
Fareed Rizkalla13-May-10 15:45
Fareed Rizkalla13-May-10 15:45 
GeneralRe: Window Resizing!? / Win32 Pin
Stephen Hewitt13-May-10 15:51
Stephen Hewitt13-May-10 15:51 
GeneralRe: Window Resizing!? / Win32 Pin
Fareed Rizkalla13-May-10 16:09
Fareed Rizkalla13-May-10 16:09 
AnswerRe: Window Resizing!? / Win32 Pin
Stephen Hewitt13-May-10 16:54
Stephen Hewitt13-May-10 16:54 
AnswerRe: Window Resizing!? / Win32 Pin
norish13-May-10 19:45
norish13-May-10 19:45 
AnswerRe: Window Resizing!? / Win32 Pin
David Crow14-May-10 8:12
David Crow14-May-10 8:12 
QuestionAsyncrhonous Multiple Processes [modified] Pin
Orion Star13-May-10 10:27
Orion Star13-May-10 10:27 
I am using Joseph M. Newcomer's WaitInfo
An Introduction to Processes: Asynchronous Process Notification[^]
to run multiple processes. I needed multiple WaitInfo because each time it will overwrite the hProcess info so I made WaitInfo into a vector
std::vector<WaitInfo> waiter


Next I have it
HANDLE hProcess = Launch(_T("notepad.exe")); //Launch = ShellExecuteEx

int idx = (int)waiter.size() + 1;
waiter.resize(idx);  // Increase vector size for the new process
waiter.at(idx-1).requestNotification(hProcess, this); 

The code can launch 3 notepad without a problem.

However upon terminating either first two notepad it would crash. If I terminate the last one it would fine.

I traced it back to
::WaitForSingleObject(hProcess, INFINITE);
notifyee->PostMessage(UWM_PROCESS_TERMINATED, 0, (LPARAM)hProcess);

For the first two hProcess became 0xfeefee and the last process had the correct hProcess value.

I am unsure why the first two lost it's hProcess value. At the time of WaitForSingleObject their hProcess were correct. Since each WaitInfo has it's own vector so it shouldn't overwrite or clear the first two.

Well from the looks of it notifyee is gone as well. WTF | :WTF: Confused | :confused:

modified on Thursday, May 13, 2010 5:58 PM

AnswerRe: Asyncrhonous Multiple Processes Pin
Stephen Hewitt13-May-10 14:08
Stephen Hewitt13-May-10 14:08 
GeneralRe: Asyncrhonous Multiple Processes Pin
Orion Star13-May-10 15:37
Orion Star13-May-10 15:37 
AnswerRe: Asyncrhonous Multiple Processes Pin
Stuart Dootson13-May-10 15:37
professionalStuart Dootson13-May-10 15:37 
GeneralRe: Asyncrhonous Multiple Processes Pin
Orion Star13-May-10 15:44
Orion Star13-May-10 15:44 
QuestionHow to write to file in little-endian or big-endian Pin
Danzy8313-May-10 9:38
Danzy8313-May-10 9:38 
AnswerRe: How to write to file in little-endian or big-endian Pin
«_Superman_»13-May-10 10:42
professional«_Superman_»13-May-10 10:42 
AnswerRe: How to write to file in little-endian or big-endian Pin
Chris Losinger13-May-10 16:24
professionalChris Losinger13-May-10 16:24 
QuestionNotify to all dialogs in my program Pin
manchukuo13-May-10 6:40
manchukuo13-May-10 6:40 
AnswerRe: Notify to all dialogs in my program Pin
Maximilien13-May-10 7:23
Maximilien13-May-10 7:23 
QuestionRe: Notify to all dialogs in my program Pin
David Crow13-May-10 8:15
David Crow13-May-10 8:15 
AnswerRe: Notify to all dialogs in my program Pin
manchukuo13-May-10 12:14
manchukuo13-May-10 12:14 
AnswerRe: Notify to all dialogs in my program Pin
«_Superman_»13-May-10 9:23
professional«_Superman_»13-May-10 9:23 
GeneralRe: Notify to all dialogs in my program Pin
manchukuo13-May-10 12:15
manchukuo13-May-10 12:15 
GeneralRe: Notify to all dialogs in my program Pin
«_Superman_»13-May-10 12:34
professional«_Superman_»13-May-10 12:34 
QuestionProcess Name Pin
john563213-May-10 6:02
john563213-May-10 6:02 
AnswerRe: Process Name Pin
«_Superman_»13-May-10 9:25
professional«_Superman_»13-May-10 9:25 
QuestionHow to launch my MFC app with params from command line? Pin
Software200713-May-10 5:58
Software200713-May-10 5:58 

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.