Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
Arnold McDonald \(AMcD\)
C'est expliqué ainsi dans la doc :
Default handlers for standard Windows messages (WM_) are predefined in class CWnd. The class library bases names for these handlers on the message name. For example, the handler for the WM_PAINT message is declared in CWnd as:
afx_msg void OnPaint();
The afx_msg keyword suggests the effect of the C++ virtual keyword by distinguishing the handlers from other CWnd member functions. Note, however, that these functions are not actually virtual; they are instead implemented through message maps. Message maps depend solely on standard preprocessor macros, not on any extensions to the C++ language. The afx_msg keyword resolves to white space after preprocessing.
Pour la déclaration, c'est dans afxwin.h :
// Type modifier for message handlers #ifndef afx_msg #define afx_msg // intentional placeholder #endif
-- Arnold McDonald (AMcD) - Help #61/2006
http://arnold.mcdonald.free.fr/
C'est expliqué ainsi dans la doc :
Default handlers for standard Windows messages (WM_) are predefined in class
CWnd. The class library bases names for these handlers on the message name.
For example, the handler for the WM_PAINT message is declared in CWnd as:
afx_msg void OnPaint();
The afx_msg keyword suggests the effect of the C++ virtual keyword by
distinguishing the handlers from other CWnd member functions. Note, however,
that these functions are not actually virtual; they are instead implemented
through message maps. Message maps depend solely on standard preprocessor
macros, not on any extensions to the C++ language. The afx_msg keyword
resolves to white space after preprocessing.
Pour la déclaration, c'est dans afxwin.h :
// Type modifier for message handlers
#ifndef afx_msg
#define afx_msg // intentional placeholder
#endif
Default handlers for standard Windows messages (WM_) are predefined in class CWnd. The class library bases names for these handlers on the message name. For example, the handler for the WM_PAINT message is declared in CWnd as:
afx_msg void OnPaint();
The afx_msg keyword suggests the effect of the C++ virtual keyword by distinguishing the handlers from other CWnd member functions. Note, however, that these functions are not actually virtual; they are instead implemented through message maps. Message maps depend solely on standard preprocessor macros, not on any extensions to the C++ language. The afx_msg keyword resolves to white space after preprocessing.
Pour la déclaration, c'est dans afxwin.h :
// Type modifier for message handlers #ifndef afx_msg #define afx_msg // intentional placeholder #endif
-- Arnold McDonald (AMcD) - Help #61/2006
http://arnold.mcdonald.free.fr/
Sylvain
JM wrote on 24/11/2006 17:19:
Ma question est simple : à quoi sert la macro afx_msg que visual studio ajoute automatiquement?
donc comme expliqué par Arnie, en effet, à rien :)
mais comme cela fait 7 lettres, comme 'virtual' cela permet des déclarations de méthodes bien alignées, c'est plus joli.
Sylvain.
JM wrote on 24/11/2006 17:19:
Ma question est simple : à quoi sert la macro afx_msg que visual studio
ajoute automatiquement?
donc comme expliqué par Arnie, en effet, à rien :)
mais comme cela fait 7 lettres, comme 'virtual' cela permet des
déclarations de méthodes bien alignées, c'est plus joli.