Click here to Skip to main content
15,917,176 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralINTERFACING THE PABX WITH A COMPUTER Pin
Wisdom200413-May-04 23:49
Wisdom200413-May-04 23:49 
GeneralRe: INTERFACING THE PABX WITH A COMPUTER Pin
Michael P Butler14-May-04 0:24
Michael P Butler14-May-04 0:24 
GeneralTake benefit of serialize but... Pin
doctorpi13-May-04 23:43
doctorpi13-May-04 23:43 
GeneralRe: Take benefit of serialize but... Pin
doctorpi13-May-04 23:48
doctorpi13-May-04 23:48 
GeneralACCESSING DATABASES USING DIALOGUE FORMS INSTEAD OF DOCUMENT FORMS/VIEWS Pin
Wisdom200413-May-04 23:39
Wisdom200413-May-04 23:39 
GeneralGDI+ Pin
CuongVT13-May-04 23:36
CuongVT13-May-04 23:36 
GeneralVS.NET Classwizard Pin
RChin13-May-04 22:50
RChin13-May-04 22:50 
GeneralRe: VS.NET Classwizard Pin
Maxwell Chen13-May-04 22:54
Maxwell Chen13-May-04 22:54 
GeneralRe: VS.NET Classwizard Pin
RChin13-May-04 22:59
RChin13-May-04 22:59 
GeneralRe: VS.NET Classwizard Pin
Anthony_Yio14-May-04 1:26
Anthony_Yio14-May-04 1:26 
GeneralTurning off Runtime checks in VC7 Pin
Anonymous13-May-04 22:10
Anonymous13-May-04 22:10 
GeneralRe: Turning off Runtime checks in VC7 Pin
Anthony_Yio14-May-04 1:57
Anthony_Yio14-May-04 1:57 
GeneralMain MFC and its Threads Pin
sweep12313-May-04 22:00
sweep12313-May-04 22:00 
GeneralRe: Main MFC and its Threads Pin
jmkhael13-May-04 23:23
jmkhael13-May-04 23:23 
GeneralRe: Main MFC and its Threads Pin
sweep12314-May-04 0:26
sweep12314-May-04 0:26 
GeneralRe: Main MFC and its Threads Pin
Jitendra gangwar14-May-04 0:47
Jitendra gangwar14-May-04 0:47 
GeneralRe: Main MFC and its Threads Pin
Roger Stoltz14-May-04 1:30
Roger Stoltz14-May-04 1:30 
GeneralRe: Main MFC and its Threads Pin
sweep12314-May-04 2:02
sweep12314-May-04 2:02 
GeneralRe: Main MFC and its Threads Pin
Roger Stoltz14-May-04 3:38
Roger Stoltz14-May-04 3:38 
sweep123 wrote:
I assume that I can define UWM_MY_MESSAGE as follows:-

#define UWM_MY_MESSAGE 0x100, or should I place it into the resource.h


When declaring your own message ID's you should at least use the WM_APP as an offset like the code example I posted earlier. WM_APP is defined in winuser.h as 0x8000.
If you should use another offset you may create a conflict with an already existing message ID. In your case from above if you should use the value 0x100 that would be in conflict with the system message WM_KEYDOWN.
Message ID's are in no way connected with resources which ID's are defined in resource.h.
You simply define the message ID for your message as
#define UWM_GOT_DATA (WM_APP + 1)
System messages have define's like WM_PAINT, WM_CLOSE and WM_QUIT. Placing the capital letter 'U' in front of the message ID is like a coding convention some of us like to use. User defined messages will easily be recognized as they begin with the capital letter 'U'. No one can force you to follow a coding convention (unless it's your boss), but it makes the code easier to read IMO.

I recommend that you have a look at Joseph Newcomer's mvp tips page at
http://www.flounder.com/mvp_tips.htm and read his essay about message management. You will find a lot of really valuable tips from his pages.

BTW, regarding threads in general...
You have to protect your data that is shared between the threads, otherwise you will end up with data corruption and other undesired behaviour. At least use critical sections.
You can read about this too at Newcomer's pages.

--
Roger
GeneralRe: Main MFC and its Threads Pin
Grahamfff14-May-04 11:39
Grahamfff14-May-04 11:39 
GeneralRe: Main MFC and its Threads Pin
Roger Stoltz16-May-04 13:13
Roger Stoltz16-May-04 13:13 
GeneralRe: Main MFC and its Threads Pin
sweep12317-May-04 2:00
sweep12317-May-04 2:00 
QuestionHow to use Amazon Web Services.. Pin
Sumit Kapoor13-May-04 21:56
Sumit Kapoor13-May-04 21:56 
AnswerRe: How to use Amazon Web Services.. Pin
Anthony_Yio14-May-04 1:46
Anthony_Yio14-May-04 1:46 
GeneralCListCtrl and CImageList question Pin
DaFrawg13-May-04 21:52
DaFrawg13-May-04 21:52 

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.