Why might be wrong when I try to doubleclick on my newly added button to a dialog in Visual Studio.

I get the following error:

Cannot add new member.

I have copied some dialogs from the .rc file and everything shows up fine when editing but when trying to add an event to a button for example I get the above error message.

I can add an event via the class wizard.

I suspect that some file is not placed where it should be.
Which file dependencies are there for the dialogs?