Click here to Skip to main content
15,902,492 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCListControl - SetSel command? Pin
IlanTal28-Feb-05 0:47
IlanTal28-Feb-05 0:47 
AnswerRe: CListControl - SetSel command? Pin
Antony M Kancidrowski28-Feb-05 1:08
Antony M Kancidrowski28-Feb-05 1:08 
GeneralRe: CListControl - SetSel command? Pin
IlanTal28-Feb-05 1:19
IlanTal28-Feb-05 1:19 
Questionhow to create dynamic controls depends on the input configuration given Pin
itjalal28-Feb-05 0:42
itjalal28-Feb-05 0:42 
Questionself update exe? Pin
ThinkingPrometheus28-Feb-05 0:33
ThinkingPrometheus28-Feb-05 0:33 
AnswerRe: self update exe? Pin
David Crow28-Feb-05 2:57
David Crow28-Feb-05 2:57 
GeneralRe: self update exe? Pin
scott sanders28-Feb-05 4:16
scott sanders28-Feb-05 4:16 
GeneralStrange Windows Messages (0x0000c0d1) Pin
Onni Qvickström28-Feb-05 0:19
sussOnni Qvickström28-Feb-05 0:19 
Hi all!

I have a really strange problem in my project. It is a rather large windows application with a lot of different Dialogs. I'm using VisualStudio 2003 and the projcet is a Win32 (not .Net) project.

The problem is that Windows (or something) sends strange WM_WHATEVER to my main window.

I added the function:

BOOL CApp::PreTranslateMessage(MSG* pMsg)
{

//Onni is blocking a nasty kind of message

char txt[100];
if((pMsg->message == WM_DEVICECHANGE || pMsg->message == WM_TIMECHANGE || pMsg->message >= 0xc0000))
{
MessageBox(NULL, itoa(pMsg->message, txt, 16), "Caught Windows Message", MB_OK);
pMsg->wParam= NULL;
return TRUE;
}
return CWinApp::PreTranslateMessage( pMsg );
}

This blocks all messages above 0xc000 (and the WM_DEVICECHANGE and WM_TIMECHANGE but I know I dont want them, it causes a crach every time if I let them trough)


In the MSDN I read that messages above 0xc000 are application defined. And that a certain function is responsible for giving uniqe values to all the applications that wants to create new messagetypes.

I have tried to block them all. This works on most computer. But sooner or later it gets stuck in a loop: I click the ok button in "Caught WindowsMessage" and as soon as the messagebox is gone another with the same number shows up. An eternal loop, all thats left to do is Ctrl-Alt-Delete.

If I let them all trough the program crashes after a few minutes with no explanation. And when I run it in debug mode I can trase the error through the callstack to the PumpMessage() with a Windows Messages with a number like 0xc0d1

Whats going on?

I never asked for those messages!
How do I get rid of this problem?

The application is due to be realeased soon and panik is creeping up on me.

Some describing smileys: Cry | :(( Sleepy | :zzz: OMG | :OMG: WTF | :WTF: Mad | :mad: Confused | :confused: Unsure | :~ Dead | X|

/Onni

Onni Qvickstrom
onni.qvickstrom@genline.se
GeneralRe: Strange Windows Messages (0x0000c0d1) Pin
Mike Dimmick28-Feb-05 6:15
Mike Dimmick28-Feb-05 6:15 
GeneralRe: Strange Windows Messages (0x0000c0d1) Pin
OnniQvickstrom1-Mar-05 21:42
OnniQvickstrom1-Mar-05 21:42 
GeneralOverlay text on screen Pin
Will227-Feb-05 23:53
Will227-Feb-05 23:53 
GeneralRe: Overlay text on screen Pin
benjymous28-Feb-05 0:19
benjymous28-Feb-05 0:19 
GeneralHelp with Ownerdraw ComboBox Pin
realAlex27-Feb-05 22:29
realAlex27-Feb-05 22:29 
QuestionAnyone expert in Image Formats ? Pin
Pantelis Georgiadis27-Feb-05 21:59
Pantelis Georgiadis27-Feb-05 21:59 
GeneralReading/Writing from/to a device Pin
User 137680027-Feb-05 21:58
User 137680027-Feb-05 21:58 
GeneralRe: Reading/Writing from/to a device Pin
ThatsAlok27-Feb-05 22:33
ThatsAlok27-Feb-05 22:33 
GeneralRe: Reading/Writing from/to a device Pin
User 137680027-Feb-05 23:05
User 137680027-Feb-05 23:05 
GeneralRe: Reading/Writing from/to a device Pin
ThatsAlok27-Feb-05 23:21
ThatsAlok27-Feb-05 23:21 
Generalcannot find cube root of a negative number in pow() Pin
tttyip27-Feb-05 21:58
tttyip27-Feb-05 21:58 
GeneralRe: cannot find cube root of a negative number in pow() Pin
Antony M Kancidrowski28-Feb-05 1:39
Antony M Kancidrowski28-Feb-05 1:39 
GeneralVideo for Windows vs. DirectShow Pin
Danoo27-Feb-05 20:53
Danoo27-Feb-05 20:53 
GeneralRe: Video for Windows vs. DirectShow Pin
Andrew Walker27-Feb-05 23:57
Andrew Walker27-Feb-05 23:57 
GeneralResource editor/compiler Pin
WildWildWind27-Feb-05 20:51
WildWildWind27-Feb-05 20:51 
GeneralRe: Resource editor/compiler Pin
the pink jedi27-Feb-05 20:59
the pink jedi27-Feb-05 20:59 
GeneralRe: Resource editor/compiler Pin
WildWildWind27-Feb-05 21:43
WildWildWind27-Feb-05 21:43 

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.