MFC VC6 error for newly added command buttons in an existing project

advertisements

I am working with a VC6 MFC project. I tried to add a command button in the existing project. When I double click on the newly added button to fire click event I am getting the below error "cannot add new member".

When i tried this with an existing command buttons in the project, it maps to the corresponding function correctly.

I tried adding the message mapping (manually) for the newly added function. But it doesn't gets called, when the event is fired.

When I tried to add class wizard for the dialog, even though the project contains all the files, VC6 can't able to find the project files and existing classes and hence it throws errors.

I tried the steps mentioned in the below links, but it doesn't work.

How to recover from MFC error "Cannot add new member"?

http://msdn.microsoft.com/en-us/library/aa295101(v=vs.60).aspx

http://social.msdn.microsoft.com/Forums/en-us/vclanguage/thread/1d4cb1f6-f471-46f9-abf3-fa9bb09d1e40

Kindly suggest me solution on how to add a command button to an existing project and also how to link the function call, corresponding to the added command button.

Thank you.


Found the solution: resource .h contains some default values

#define _APS_NEXT_CONTROL_VALUE 1025

The next control which we place in the form should the _APS_NEXT_CONTROL_VALUE defined in resource.h.