Click here to Skip to main content
16,016,087 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralInitializing data structure Pin
Todd Smith28-Aug-02 8:31
Todd Smith28-Aug-02 8:31 
GeneralRe: Initializing data structure Pin
Maciej Pirog28-Aug-02 9:35
Maciej Pirog28-Aug-02 9:35 
GeneralRe: Initializing data structure Pin
Todd Smith28-Aug-02 12:42
Todd Smith28-Aug-02 12:42 
GeneralRe: Initializing data structure Pin
Maciej Pirog29-Aug-02 2:34
Maciej Pirog29-Aug-02 2:34 
GeneralRe: Initializing data structure Pin
jhwurmbach29-Aug-02 2:43
jhwurmbach29-Aug-02 2:43 
GeneralRe: Initializing data structure Pin
Maciej Pirog29-Aug-02 3:53
Maciej Pirog29-Aug-02 3:53 
GeneralON_MESSAGE .NET Issue Pin
Ryan B.28-Aug-02 8:01
Ryan B.28-Aug-02 8:01 
GeneralRe: ON_MESSAGE .NET Issue Pin
Fazlul Kabir28-Aug-02 8:46
Fazlul Kabir28-Aug-02 8:46 
MFC7 (in VS .NET) uses stricter type checking with message map macros. It looks like you need to replace the return from ‘void’ to ‘LRESULT’. Also make sure you supply the correct function parameters, such as (WPARAM, LPARAM) etc.
More on this here [click on Microsoft Foundation Class (MFC) link]

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcedit/html/vcrefWhatsNewLibrariesVisualC70.asp[^]



Static Casting and MFC Message Maps Beginning with Visual C++ .NET, MFC provides stricter type checking for return and parameter types of message handler functions. This new behavior notifies the developer of potential problems by flagging potentially unsafe message handlers with an error message. MFC now uses static casts for ON_MESSAGE, ON_REGISTERED_MESSAGE, ON_THREAD_MESSAGE, and ON_REGISTERED_THREAD_MESSAGE.
For example, in the past a developer could use a member function that returned void instead of LRESULT for ON_MESSAGE or ON_REGISTERED_MESSAGE and compile without any errors. With Visual C++ .NET, the potential miscast is caught and flagged as an error. The developer can fix the potential problem by replacing the return type (with LRESULT) and recompiling.


Hope this helps.

// Fazlul



Get RadVC today! Play RAD in VC++
http://www.capitolsoft.com

GeneralRe: ON_MESSAGE .NET Issue Pin
Nick Hodapp28-Aug-02 9:59
sitebuilderNick Hodapp28-Aug-02 9:59 
GeneralRe: ON_MESSAGE .NET Issue Pin
Michael Dunn28-Aug-02 12:28
sitebuilderMichael Dunn28-Aug-02 12:28 
QuestionHow do I create a View and assing it his document class Pin
Jose Cruz28-Aug-02 7:46
Jose Cruz28-Aug-02 7:46 
AnswerRe: How do I create a View and assing it his document class Pin
Pavel Klocek28-Aug-02 11:03
Pavel Klocek28-Aug-02 11:03 
AnswerRe: How do I create a View and assing it his document class Pin
Pavel Klocek29-Aug-02 3:54
Pavel Klocek29-Aug-02 3:54 
GeneralCRichEditView without doc/view... Pin
Anonymous28-Aug-02 7:40
Anonymous28-Aug-02 7:40 
GeneralRe: CRichEditView without doc/view... Pin
.dan.g.28-Aug-02 21:36
professional.dan.g.28-Aug-02 21:36 
GeneralRe: CRichEditView without doc/view... Pin
Anonymous29-Aug-02 9:47
Anonymous29-Aug-02 9:47 
GeneralRe: CRichEditView without doc/view... Pin
.dan.g.1-Sep-02 13:55
professional.dan.g.1-Sep-02 13:55 
GeneralRe: CRichEditView without doc/view... Pin
.dan.g.2-Sep-02 15:33
professional.dan.g.2-Sep-02 15:33 
GeneralRe: CRichEditView without doc/view... Pin
Anonymous3-Sep-02 21:51
Anonymous3-Sep-02 21:51 
GeneralHelp!!! How to Use ActiveX control's Properties in VC++ Pin
david_fan28-Aug-02 7:23
david_fan28-Aug-02 7:23 
GeneralConnect more than two tables in CGridCtrl Pin
Pole28-Aug-02 6:56
Pole28-Aug-02 6:56 
GeneralRe: Connect more than two tables in CGridCtrl Pin
Mazdak28-Aug-02 7:59
Mazdak28-Aug-02 7:59 
GeneralFirst Chance exception Pin
boon kian28-Aug-02 6:43
boon kian28-Aug-02 6:43 
GeneralRe: First Chance exception Pin
Emilio Guijarro28-Aug-02 6:48
Emilio Guijarro28-Aug-02 6:48 
GeneralRe: First Chance exception Pin
Chris Losinger28-Aug-02 6:49
professionalChris Losinger28-Aug-02 6:49 

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.