Look at this horrible casting
-
Hi, Look at this nasty type casting. any one can help?
(AFX_PMSG)(AFX_PMSGW)(int (AFX_MSG_CALL CWnd::*)(LPCREEATESTRUCT))OnCreate
note:
typedef void (AFX_MSG_CALL CCmdTarget::*AFX_PMSG)(void);
These codes come from MessageMapping and Message Rounting. Thank you. Best regard. I confess that I am a stubborn guy, but why not put things thoroughly, logically and systematically clean. One concrete prolem is worth a thousand unapplied abstractions.
-
Hi, Look at this nasty type casting. any one can help?
(AFX_PMSG)(AFX_PMSGW)(int (AFX_MSG_CALL CWnd::*)(LPCREEATESTRUCT))OnCreate
note:
typedef void (AFX_MSG_CALL CCmdTarget::*AFX_PMSG)(void);
These codes come from MessageMapping and Message Rounting. Thank you. Best regard. I confess that I am a stubborn guy, but why not put things thoroughly, logically and systematically clean. One concrete prolem is worth a thousand unapplied abstractions.
What are you asking about? But, in general you have to remember that the message map table just contains generic routine pointers. Thus, they have to be cast to the proper routine protocol when they are to be invoked. Tim Smith I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
-
What are you asking about? But, in general you have to remember that the message map table just contains generic routine pointers. Thus, they have to be cast to the proper routine protocol when they are to be invoked. Tim Smith I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
Can you explain the code for me in detail? I mean word by word. Thank you. Best regard. I confess that I am a stubborn guy, but why not put things thoroughly, logically and systematically clean. One concrete prolem is worth a thousand unapplied abstractions.
-
Can you explain the code for me in detail? I mean word by word. Thank you. Best regard. I confess that I am a stubborn guy, but why not put things thoroughly, logically and systematically clean. One concrete prolem is worth a thousand unapplied abstractions.
NicholasCougar wrote: Can you explain the code for me in detail? I mean word by word. There is no need to explain it more than to say that they cast a pointer to a member function into another type of function pointer. But to spell it out, I think it's spelled something like: Emm eff see sucks, partially because Microsoft lagged ~5 years behind the competing C++ implementation, and partially since the AFX (remember, it was Application Framework eXperimental - probably with emphasis on the experimental part) group wasn't too good at neither design nor C++. Sure, using the inferior MS compiler they actually managed to make something work, sometimes... But the price we got to pay for this was un-typesafety that has wasted several hundred of thousands of developer hours around the globe to date.