Click here to Skip to main content
15,891,708 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: on-the-fly html file generation Pin
Muhammad Azam28-Jun-06 2:33
Muhammad Azam28-Jun-06 2:33 
QuestionSerialization Pin
_Tom_28-Jun-06 0:44
_Tom_28-Jun-06 0:44 
AnswerRe: Serialization [modified] Pin
Sarath C28-Jun-06 0:54
Sarath C28-Jun-06 0:54 
AnswerRe: Serialization Pin
bob1697228-Jun-06 3:25
bob1697228-Jun-06 3:25 
GeneralRe: Serialization Pin
ovidiucucu28-Jun-06 8:22
ovidiucucu28-Jun-06 8:22 
GeneralRe: Serialization Pin
bob1697228-Jun-06 10:24
bob1697228-Jun-06 10:24 
GeneralRe: Serialization [modified] Pin
ovidiucucu29-Jun-06 2:30
ovidiucucu29-Jun-06 2:30 
QuestionPeeking into the message queue of another thread Pin
Phil.Benson27-Jun-06 23:54
professionalPhil.Benson27-Jun-06 23:54 
After reading the API for PeekMessage, this only works with the message queue of the current thread. I have tried using this function in another thread, and passing the HWND of the MainApp´s window and this does not work. (If I have understood the MSDN correctly, this is the correct behavour). Is it possible to peek into the message queue of another thread?. For example


UINT ThreadProc(LPVOID pVoid){

MSG msg;
struct_t* pS = reinterpret_cast<struct_t*>(pVoid);

HANDLE hEvent = CreateEvent(NULL, TRUE, FALSE, _T("NAMED_EVENT");
ASSERT(NULL != hEvent);
if(NULL == hEvent){
return 1;
}
DWORD dwWait = 0;
BOOL bContinue = TRUE;

while(bContinue){
dwWait = WaitForSingleObject(hEvent, 1000);
switch(dwWait){

case WAIT_TIMEOUT:
while(::PeekMessage(&msg, pS->hWnd, NULL, NULL, PM_NOREMOVE)){
bContinue = pS->pThread->PumpMessage();
}
break;

case WAIT_OBJECT_0:
bContinue = FALSE;
break;
}
}

return 0;
}

struct_t is just an example of what I am passing. The HWND of the main application window, and pThread the CWinThread of the main application.

Any suggestions would be appriciated...
Thanks



bum... and I thought I´d got rid of all the bugs Frown | :(
AnswerRe: Peeking into the message queue of another thread Pin
Sarath C28-Jun-06 0:47
Sarath C28-Jun-06 0:47 
GeneralRe: Peeking into the message queue of another thread Pin
Phil.Benson28-Jun-06 1:36
professionalPhil.Benson28-Jun-06 1:36 
GeneralRe: Peeking into the message queue of another thread [modified] Pin
Justin Tay28-Jun-06 2:39
Justin Tay28-Jun-06 2:39 
GeneralRe: Peeking into the message queue of another thread Pin
Phil.Benson28-Jun-06 2:54
professionalPhil.Benson28-Jun-06 2:54 
GeneralRe: Peeking into the message queue of another thread [modified] Pin
Justin Tay28-Jun-06 3:02
Justin Tay28-Jun-06 3:02 
GeneralRe: Peeking into the message queue of another thread Pin
Phil.Benson28-Jun-06 3:29
professionalPhil.Benson28-Jun-06 3:29 
GeneralRe: Peeking into the message queue of another thread Pin
Justin Tay28-Jun-06 3:38
Justin Tay28-Jun-06 3:38 
GeneralRe: Peeking into the message queue of another thread Pin
Phil.Benson28-Jun-06 5:33
professionalPhil.Benson28-Jun-06 5:33 
QuestionDatabase error in C++ Pin
aSoundMind27-Jun-06 23:29
aSoundMind27-Jun-06 23:29 
Questionanother kind of linker error Pin
Desmo1627-Jun-06 23:25
Desmo1627-Jun-06 23:25 
AnswerRe: another kind of linker error Pin
_AnsHUMAN_ 27-Jun-06 23:28
_AnsHUMAN_ 27-Jun-06 23:28 
AnswerRe: another kind of linker error Pin
Cedric Moonen27-Jun-06 23:33
Cedric Moonen27-Jun-06 23:33 
AnswerRe: another kind of linker error Pin
Sarath C27-Jun-06 23:41
Sarath C27-Jun-06 23:41 
QuestionMessageBox French Pin
dungpapai27-Jun-06 23:04
dungpapai27-Jun-06 23:04 
AnswerRe: MessageBox French Pin
Cedric Moonen27-Jun-06 23:21
Cedric Moonen27-Jun-06 23:21 
AnswerRe: MessageBox French Pin
Sarath C27-Jun-06 23:26
Sarath C27-Jun-06 23:26 
AnswerRe: MessageBox French Pin
FarPointer27-Jun-06 23:26
FarPointer27-Jun-06 23:26 

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.