Click here to Skip to main content
15,914,500 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: request to all Pin
David Crow13-Jan-05 3:55
David Crow13-Jan-05 3:55 
GeneralGUI capturing Pin
kedar.dave12-Jan-05 22:01
kedar.dave12-Jan-05 22:01 
GeneralRe: GUI capturing Pin
Selvam R12-Jan-05 23:02
professionalSelvam R12-Jan-05 23:02 
GeneralRe: GUI capturing Pin
kedar.dave13-Jan-05 17:27
kedar.dave13-Jan-05 17:27 
GeneralRevision Control System and Tools Pin
George Ionescu12-Jan-05 21:40
George Ionescu12-Jan-05 21:40 
QuestionFilesss.... Help? Pin
nutkase12-Jan-05 21:25
nutkase12-Jan-05 21:25 
AnswerRe: Filesss.... Help? Pin
David Crow13-Jan-05 3:57
David Crow13-Jan-05 3:57 
QuestionCopy Folder? Pin
Larsson12-Jan-05 21:14
Larsson12-Jan-05 21:14 
AnswerRe: Copy Folder? Pin
namaskaaram12-Jan-05 21:47
namaskaaram12-Jan-05 21:47 
GeneralRe: Copy Folder? Pin
Larsson12-Jan-05 23:13
Larsson12-Jan-05 23:13 
GeneralRe: Copy Folder? Pin
ThatsAlok13-Jan-05 0:57
ThatsAlok13-Jan-05 0:57 
GeneralRe: Copy Folder? Pin
Larsson13-Jan-05 1:15
Larsson13-Jan-05 1:15 
GeneralShellExecute Pin
T i T i12-Jan-05 21:13
T i T i12-Jan-05 21:13 
GeneralRe: ShellExecute Pin
Antony M Kancidrowski12-Jan-05 23:44
Antony M Kancidrowski12-Jan-05 23:44 
GeneralI am confused with this: Pin
Noble D. Bell12-Jan-05 17:50
Noble D. Bell12-Jan-05 17:50 
GeneralRe: I am confused with this: Pin
ThatsAlok12-Jan-05 18:24
ThatsAlok12-Jan-05 18:24 
GeneralRe: I am confused with this: Pin
ThatsAlok12-Jan-05 18:25
ThatsAlok12-Jan-05 18:25 
GeneralRe: I am confused with this: Pin
Selvam R12-Jan-05 23:26
professionalSelvam R12-Jan-05 23:26 
GeneralPROBLEM DRAWING WITH A MOUSE Pin
phijophlip12-Jan-05 17:06
phijophlip12-Jan-05 17:06 
GeneralRe: PROBLEM DRAWING WITH A MOUSE Pin
namaskaaram12-Jan-05 17:46
namaskaaram12-Jan-05 17:46 
GeneralRe: PROBLEM DRAWING WITH A MOUSE Pin
ThatsAlok12-Jan-05 18:49
ThatsAlok12-Jan-05 18:49 
GeneralCompiler error!! !! Pin
LiYS12-Jan-05 16:10
LiYS12-Jan-05 16:10 
GeneralRe: Compiler error!! !! Pin
nutkase12-Jan-05 22:18
nutkase12-Jan-05 22:18 
GeneralON_WM_KILLFOCUS Pin
digwizfox12-Jan-05 15:23
digwizfox12-Jan-05 15:23 
The following code snips relate to code that successfully compiled using Visual Studio 6.0. This same implementation does not compile in Visual Studio .Net 7.0. Here is the error message

ConfigTSAControlsFView.cpp(200) : error C2440: 'static_cast' : cannot convert from 'void (__thiscall CConfigTSAControlsFView::* )(UINT)' to 'void (__thiscall CWnd::* )(CWnd *)'


//Function Declaration
afx_msg void OnKillFocus(UINT uiCtrlID);

//Message Map Entry
ON_WM_KILLFOCUS()

//Function Implementation
void CConfigTSAControlsFView::OnKillFocus(UINT uiCtrlID)
{
//the code
}

Now this is what confuses me the most. The MSDN library implies that the OnKillFocus method takes a CWnd*, not a UINT. Visual studio 6.0, somehow was able to compile this and perform a cast. However, Visual Studio .net is complaining that the static_cast is not possible. So can someone explain to me how visual studio 6.0 can make the cast and why visual studio .Net cannot? The uiCntrlId is used in a switch statement so the actual value being used is equal to the resource Id of the window. How did visual studio cast from a CWnd* to a resource Id automatically? This seems like quite a stretch. If anyone has any ideas, I'd appreciate it.

Personally, I think the error message makes perfect sense. Of course the compiler won't cast from a CWnd* to a UINT that has a completely different meaning. I just can't imagine how the code ever compiled and worked with visual studio 6.0. The other thing is that if I change the code to use a CWND*, then it seems to invalidate the existing switch statements, within the function, that expects a controller id.


GeneralRe: ON_WM_KILLFOCUS Pin
Ryan Binns12-Jan-05 17:00
Ryan Binns12-Jan-05 17:00 

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.