Click here to Skip to main content
14,602,044 members

C / C++ / MFC

 
GeneralRe: C programming Question on Characters Pin
David Crow23-Dec-18 12:50
MemberDavid Crow23-Dec-18 12:50 
GeneralRe: C programming Question on Characters Pin
David Crow23-Dec-18 12:54
MemberDavid Crow23-Dec-18 12:54 
AnswerRe: C programming Question on Characters Pin
jschell23-Dec-18 7:43
Memberjschell23-Dec-18 7:43 
QuestionMessage Closed Pin
22-Dec-18 2:53
MemberAlexander Kindel22-Dec-18 2:53 
AnswerRe: Spurious end of file error from ifstream::read Pin
Richard MacCutchan22-Dec-18 4:37
mveRichard MacCutchan22-Dec-18 4:37 
QuestionPostMessage fails with ERROR_NOT_ENOUGH_QUOTA (PROBLEM FOUND, thanks all) Pin
Maximilien19-Dec-18 4:53
MemberMaximilien19-Dec-18 4:53 
QuestionRe: PostMessage fails with ERROR_NOT_ENOUGH_QUOTA Pin
David Crow19-Dec-18 5:13
MemberDavid Crow19-Dec-18 5:13 
AnswerRe: PostMessage fails with ERROR_NOT_ENOUGH_QUOTA Pin
Maximilien19-Dec-18 6:45
MemberMaximilien19-Dec-18 6:45 
The main Application/UI thread is not blocked, I can still interact with it and manually stop the worker thread.

The message is to trigger a function in the MainFrame that will set an event (SetEvent).

The handler for the MESSAGEID id is never called. (breakpoint never triggered); so the event is never triggered.
(I know the INFINITE is not the best idea, but it is approved)

My pseudo-code is something like that :

Worker Thread:
void f(CWnd* p) // p is a pointer to the mainframe
{ 
  p->PostMessage(MESSAGEID, 0, 0 );

  const DWORD dwEvent = WaitForMultipleObjects(NB_EVENT_REGISTERED, ghEventList, FALSE, INFINITE);
  // .... 
}

Main UI thread.
ON_MESSAGE(MESSAGEID, OnMESSAGEID )
//....

LRESULT CMainFrame::OnMESSAGEID (WPARAM wParam, LPARAM  lParam)
{
  //... do stuff.
  SetEvent(ghEventList[0]);
}
I'd rather be phishing!

AnswerRe: PostMessage fails with ERROR_NOT_ENOUGH_QUOTA Pin
Richard MacCutchan19-Dec-18 5:15
mveRichard MacCutchan19-Dec-18 5:15 
GeneralRe: PostMessage fails with ERROR_NOT_ENOUGH_QUOTA Pin
Maximilien19-Dec-18 6:46
MemberMaximilien19-Dec-18 6:46 
GeneralRe: PostMessage fails with ERROR_NOT_ENOUGH_QUOTA Pin
Richard MacCutchan19-Dec-18 21:56
mveRichard MacCutchan19-Dec-18 21:56 
GeneralRe: PostMessage fails with ERROR_NOT_ENOUGH_QUOTA Pin
Maximilien20-Dec-18 2:04
MemberMaximilien20-Dec-18 2:04 
GeneralRe: PostMessage fails with ERROR_NOT_ENOUGH_QUOTA Pin
Maximilien20-Dec-18 5:16
MemberMaximilien20-Dec-18 5:16 
GeneralRe: PostMessage fails with ERROR_NOT_ENOUGH_QUOTA Pin
Richard MacCutchan20-Dec-18 6:06
mveRichard MacCutchan20-Dec-18 6:06 
AnswerRe: PostMessage fails with ERROR_NOT_ENOUGH_QUOTA Pin
Randor 19-Dec-18 14:32
professional Randor 19-Dec-18 14:32 
QuestionMacro analysis - help wanted Pin
Vaclav_18-Dec-18 3:43
MemberVaclav_18-Dec-18 3:43 
AnswerRe: Macro analysis - help wanted Pin
leon de boer18-Dec-18 6:03
Memberleon de boer18-Dec-18 6:03 
GeneralRe: Macro analysis - help wanted Pin
Vaclav_18-Dec-18 6:44
MemberVaclav_18-Dec-18 6:44 
GeneralRe: Macro analysis - help wanted Pin
leon de boer18-Dec-18 7:47
Memberleon de boer18-Dec-18 7:47 
GeneralRe: Macro analysis - help wanted Pin
Vaclav_18-Dec-18 13:30
MemberVaclav_18-Dec-18 13:30 
SuggestionRe: Macro analysis - help wanted Pin
David Crow18-Dec-18 10:04
MemberDavid Crow18-Dec-18 10:04 
GeneralRe: Macro analysis - help wanted Pin
Vaclav_18-Dec-18 13:32
MemberVaclav_18-Dec-18 13:32 
QuestionPlacing the dialog bar Pin
manoharbalu17-Dec-18 23:12
Membermanoharbalu17-Dec-18 23:12 
AnswerRe: Placing the dialog bar Pin
Richard MacCutchan17-Dec-18 23:48
mveRichard MacCutchan17-Dec-18 23:48 
GeneralRe: Placing the dialog bar Pin
manoharbalu18-Dec-18 1:42
Membermanoharbalu18-Dec-18 1:42 

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.