Click here to Skip to main content
15,910,981 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: C++ Pin
CPallini13-May-10 20:48
mveCPallini13-May-10 20:48 
AnswerRe: C++ Pin
Richard MacCutchan13-May-10 23:13
mveRichard MacCutchan13-May-10 23:13 
QuestionIn Visual Studio 2008 I try to Go To Dialog and get "The operation could not be completed. Access is denied." Pin
ara206013-May-10 15:21
ara206013-May-10 15:21 
AnswerRe: In Visual Studio 2008 I try to Go To Dialog and get "The operation could not be completed. Access is denied." Pin
ForNow13-May-10 16:12
ForNow13-May-10 16:12 
GeneralRe: In Visual Studio 2008 I try to Go To Dialog and get "The operation could not be completed. Access is denied." Pin
ara206013-May-10 16:19
ara206013-May-10 16:19 
AnswerRe: In Visual Studio 2008 I try to Go To Dialog and get "The operation could not be completed. Access is denied." Pin
bolivar12314-May-10 2:48
bolivar12314-May-10 2:48 
GeneralRe: In Visual Studio 2008 I try to Go To Dialog and get "The operation could not be completed. Access is denied." Pin
ara206014-May-10 14:42
ara206014-May-10 14:42 
QuestionVIsual Studio Debugger Yellow arrow cursor/control ??? Pin
ForNow13-May-10 14:45
ForNow13-May-10 14:45 
AnswerRe: VIsual Studio Debugger Yellow arrow cursor/control ??? Pin
hdxu13-May-10 16:21
hdxu13-May-10 16:21 
AnswerRe: VIsual Studio Debugger Yellow arrow cursor/control ??? Pin
hdxu13-May-10 16:28
hdxu13-May-10 16:28 
GeneralRe: VIsual Studio Debugger Yellow arrow cursor/control ??? Pin
ForNow13-May-10 16:34
ForNow13-May-10 16:34 
GeneralRe: VIsual Studio Debugger Yellow arrow cursor/control ??? Pin
Madhu Nair13-May-10 19:02
Madhu Nair13-May-10 19:02 
GeneralRe: VIsual Studio Debugger Yellow arrow cursor/control ??? Pin
ForNow13-May-10 20:17
ForNow13-May-10 20:17 
QuestionWindow Resizing!? / Win32 Pin
Fareed Rizkalla13-May-10 12:42
Fareed Rizkalla13-May-10 12:42 
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 

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.