I don't understand the syntax. 
Author Message
 I don't understand the syntax.

There is the syntax in the \PROGRAM FILES\MICROSOFT VISUAL
STUDIO\VC98\MFC\Include\AFXMSG_.H (line: 475)

I need it to understand MESSAGE MAP better. I know how to declare message
maps but I know that there is MFC source. How I know there are not any
implementation of the OnLButtonDown function, I think that you must
implement it alone there where you need it.

But if could somebody tell me what is the syntax below like. I cannot
mannage there.

#define ON_WM_LBUTTONDOWN() \
{ WM_LBUTTONDOWN, 0, 0, 0, AfxSig_vwp, \
(AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT,
CPoint))&OnLButtonDown },

I don't understand followed:

Dissection:

{   WM_LBUTTONDOWN, 0, 0, 0,  // understand  \

(AFX_PMSG)(AFX_PMSGW) // I think these are defines and double conversion? \

(void (AFX_MSG_CALL CWnd::*) // I think this is a  operator in the CWnd
class but it returns void?  \

(UINT,CPoint)) // I understand that those are the arguments. \

&OnLButtonDown }, I think that this is the name for programmer defined
function in a derived class? \

In general I think that this is pointer to the programmer defined function
named OnLButtonDown. I is invokd when user click the right button on the
mouse of course.

Please if Somebody can help me.



Sun, 02 Jan 2005 15:38:23 GMT  
 I don't understand the syntax.
Check out MFC Internals by Shepherd and Wingo / Addison-Wesley.

Quote:

> There is the syntax in the \PROGRAM FILES\MICROSOFT VISUAL
> STUDIO\VC98\MFC\Include\AFXMSG_.H (line: 475)

> I need it to understand MESSAGE MAP better. I know how to declare message
> maps but I know that there is MFC source. How I know there are not any
> implementation of the OnLButtonDown function, I think that you must
> implement it alone there where you need it.

> But if could somebody tell me what is the syntax below like. I cannot
> mannage there.

> #define ON_WM_LBUTTONDOWN() \
> { WM_LBUTTONDOWN, 0, 0, 0, AfxSig_vwp, \
> (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT,
> CPoint))&OnLButtonDown },

> I don't understand followed:

> Dissection:

> {   WM_LBUTTONDOWN, 0, 0, 0,  // understand  \

> (AFX_PMSG)(AFX_PMSGW) // I think these are defines and double conversion?
\

> (void (AFX_MSG_CALL CWnd::*) // I think this is a  operator in the CWnd
> class but it returns void?  \

> (UINT,CPoint)) // I understand that those are the arguments. \

> &OnLButtonDown }, I think that this is the name for programmer defined
> function in a derived class? \

> In general I think that this is pointer to the programmer defined function
> named OnLButtonDown. I is invokd when user click the right button on the
> mouse of course.

> Please if Somebody can help me.



Sun, 02 Jan 2005 14:26:37 GMT  
 I don't understand the syntax.
Let's start with the missing piece.  OnLButtonDown is declared somewhere as
something like:
    void CMyWnd::OnLButtonDown (UINT id, CPoint p);

now, we want to put the address of that into a element of a struct.  The
problem is that the struct is defined long before CMyWnd, so we can refer to
that in the struct definition.  So, for whatever reason MS wanted, the
element is defined as a AFX_PMSG object.  That means we have to cast the
function's address to that type.  For whatever reason, that takes three
steps.  First to a pointer to a CWnd member function:
    void (AFX_MSG_CALL CWnd::*)(UINT, CPoint))

then to a AFX_PMSGW and then to a AFX_PMSG.

--
Truth,
James Curran
www.NovelTheory.com  (Personal)
www.NJTheater.com   (Professional)
www.aurora-inc.com   (Day job)


Quote:
> Check out MFC Internals by Shepherd and Wingo / Addison-Wesley.


> > There is the syntax in the \PROGRAM FILES\MICROSOFT VISUAL
> > STUDIO\VC98\MFC\Include\AFXMSG_.H (line: 475)

> > I need it to understand MESSAGE MAP better. I know how to declare
message
> > maps but I know that there is MFC source. How I know there are not any
> > implementation of the OnLButtonDown function, I think that you must
> > implement it alone there where you need it.

> > But if could somebody tell me what is the syntax below like. I cannot
> > mannage there.

> > #define ON_WM_LBUTTONDOWN() \
> > { WM_LBUTTONDOWN, 0, 0, 0, AfxSig_vwp, \
> > (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT,
> > CPoint))&OnLButtonDown },

> > I don't understand followed:

> > Dissection:

> > {   WM_LBUTTONDOWN, 0, 0, 0,  // understand  \

> > (AFX_PMSG)(AFX_PMSGW) // I think these are defines and double
conversion?
> \

> > (void (AFX_MSG_CALL CWnd::*) // I think this is a  operator in the CWnd
> > class but it returns void?  \

> > (UINT,CPoint)) // I understand that those are the arguments. \

> > &OnLButtonDown }, I think that this is the name for programmer defined
> > function in a derived class? \

> > In general I think that this is pointer to the programmer defined
function
> > named OnLButtonDown. I is invokd when user click the right button on the
> > mouse of course.

> > Please if Somebody can help me.



Sun, 02 Jan 2005 21:49:19 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Don't understand what's Functions

2. Don't understand what's Functions

3. Very Hard to understand C# syntax in Microsoft's Web Data Admin Tool

4. Please help, I don't understand

5. I don't understand...

6. I don't understand

7. warning I don't understand

8. I don't understand

9. Runtime output -- Don't understand!?

10. I don't understand bitwist functions

11. Still don't understand this...

12. Don't understand pointers to functions!

 

 
Powered by phpBB® Forum Software