About MFC controls remove the "control already exists with this ID" solution, detailed, online is not so detailed, I was "deeply hurt", so I would like to share the detailed method.

Source: Internet
Author: User

On-Line about MFC controls remove the "control with this ID already exists" situation, found on the internet a lot about this aspect of things, but are not very full, it is not easy to figure out. Now ask me directly through a project and picture form and share a solution with you (if there is no, please learn from each other, qq1035169610):

1. To create an MFC project, which is limited to presentation, name the project "Lu".

2. The following is the addition of the button control to the graphical interface box. The results are as follows:

3. Simply pull the control into the graphical interface and create a macro in the Resource.h file, as shown in:

4. Then start changing the name and ID of the control. Here we set the name and ID to Lu and idc_lu, respectively.

Here is an ID with the same number as the original macro, as follows:

In this case, it is equivalent to the same ID (1001) corresponding to the name of two macros. At this time, as long as the name before the change of the macro delete the line, in other files are used in the modified control name and the name of the changed macro.

another case is that if you want to change the second button to the name of the first button, you must delete the macro in Resource.h (the second row) and then save it, and then change the name and idc_*** in the space. In this way, you will find , it has been successfully changed. Finally, the line just deleted is pasted into the Resource.h, so that all the changes have been successful.

About MFC controls remove the "control already exists with this ID" solution, detailed, online is not so detailed, I was "deeply hurt", so I would like to share the detailed method.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.