Click here to Skip to main content
15,884,177 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: WaitForMultipleObjects getting access violation in Worker Thread Pin
ForNow10-May-21 2:20
ForNow10-May-21 2:20 
GeneralRe: WaitForMultipleObjects getting access violation in Worker Thread Pin
Victor Nijegorodov10-May-21 3:32
Victor Nijegorodov10-May-21 3:32 
GeneralRe: WaitForMultipleObjects getting access violation in Worker Thread Pin
ForNow10-May-21 3:57
ForNow10-May-21 3:57 
GeneralRe: WaitForMultipleObjects getting access violation in Worker Thread Pin
Victor Nijegorodov10-May-21 4:06
Victor Nijegorodov10-May-21 4:06 
GeneralRe: WaitForMultipleObjects getting access violation in Worker Thread Pin
ForNow10-May-21 4:25
ForNow10-May-21 4:25 
GeneralRe: WaitForMultipleObjects getting access violation in Worker Thread Pin
Victor Nijegorodov10-May-21 4:39
Victor Nijegorodov10-May-21 4:39 
GeneralRe: WaitForMultipleObjects getting access violation in Worker Thread Pin
ForNow10-May-21 4:51
ForNow10-May-21 4:51 
AnswerRe: WaitForMultipleObjects getting access violation in Worker Thread Pin
Randor 11-May-21 12:30
professional Randor 11-May-21 12:30 
ForNow wrote:
I pass all the info (HWND windows


The MFC framework does not always give you the *real* HWND to a window. As strange as this might sound, the MFC framework maintains two object maps. The 'real objects' and an internal 'temporary handle map'. MFC will sometimes give you a temporary CTempWnd instead. If you are passing the window handle of a MFC class then you need to use CWnd::GetSafeHwnd[^]. There are some rare occasions where GetSafeHwnd cannot give you the real window handle and will return NULL instead so you should probably check for that too.

Not many people are using MFC these days. You should consider moving on.

I can't think of much else that would cause WaitForMultipleObjects to throw an access violation. The only other thing I can think of... is a corrupt heap. Sounds like you are somehow passing garbage to WaitForMultipleObjects.

Best Wishes,
-David Delaune
GeneralRe: WaitForMultipleObjects getting access violation in Worker Thread Pin
ForNow12-May-21 1:36
ForNow12-May-21 1:36 
GeneralRe: WaitForMultipleObjects getting access violation in Worker Thread Pin
Victor Nijegorodov12-May-21 2:00
Victor Nijegorodov12-May-21 2:00 
GeneralRe: WaitForMultipleObjects getting access violation in Worker Thread Pin
ForNow12-May-21 2:30
ForNow12-May-21 2:30 
GeneralRe: WaitForMultipleObjects getting access violation in Worker Thread Pin
Victor Nijegorodov12-May-21 2:37
Victor Nijegorodov12-May-21 2:37 
GeneralRe: WaitForMultipleObjects getting access violation in Worker Thread Pin
ForNow12-May-21 2:47
ForNow12-May-21 2:47 
QuestionC, Pin
Ajay Kumar May20214-May-21 20:49
Ajay Kumar May20214-May-21 20:49 
AnswerRe: C, Pin
Richard MacCutchan4-May-21 21:23
mveRichard MacCutchan4-May-21 21:23 
AnswerRe: C, Pin
Gerry Schmitz5-May-21 8:29
mveGerry Schmitz5-May-21 8:29 
QuestionC2065 'IUrlHistoryStg2Ptr': undeclared identifier Pin
Saikat_EPAM28-Apr-21 22:25
Saikat_EPAM28-Apr-21 22:25 
AnswerRe: C2065 'IUrlHistoryStg2Ptr': undeclared identifier Pin
Richard MacCutchan28-Apr-21 23:12
mveRichard MacCutchan28-Apr-21 23:12 
GeneralRe: C2065 'IUrlHistoryStg2Ptr': undeclared identifier Pin
CPallini29-Apr-21 0:20
mveCPallini29-Apr-21 0:20 
GeneralRe: C2065 'IUrlHistoryStg2Ptr': undeclared identifier Pin
Victor Nijegorodov29-Apr-21 1:51
Victor Nijegorodov29-Apr-21 1:51 
AnswerRe: C2065 'IUrlHistoryStg2Ptr': undeclared identifier Pin
Richard MacCutchan29-Apr-21 2:18
mveRichard MacCutchan29-Apr-21 2:18 
QuestionMessage Closed Pin
28-Apr-21 4:41
Member 1496877128-Apr-21 4:41 
AnswerRe: How to "link" two C++ applications ? Pin
Richard MacCutchan28-Apr-21 5:41
mveRichard MacCutchan28-Apr-21 5:41 
AnswerRe: How to "link" two C++ applications ? Pin
Sean Ewington28-Apr-21 5:45
staffSean Ewington28-Apr-21 5:45 
QuestionWSARecv question Pin
ForNow25-Apr-21 17:17
ForNow25-Apr-21 17:17 

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.