[MFC] VS2013 version of MFC works ported to VC6.0

Source: Internet
Author: User

: vs is known as "the strongest IDE in the universe", but sometimes the installation package is too big, it's just a few g, and there's a lot more to be done when it's installed, and that's what the Virgo people are going to endure! This article is not a spit slot, but rather an IDE that does not have to install a new version of a few g in an emergency scenario, but instead moves the higher version of the project to the lower version of the IDE and makes it work and debug the solution ~

VS2013 version of MFC works ported to VC6.0

1. Scene reproduction

I recently got an Ubuntu system and installed a win7 in VirtualBox to install the design PCB and the embedded integrated development environment Keil. The project needs to use a small application that I wrote earlier to burn a picture through a serial port to a hardware flash, but I did not have an. exe program in my previous backup project, so I need to recompile! But because of the sudden incident, download a VS2013 installation package and install obviously "cucumber dishes are cold" ~ so I took a bold try to convert the higher version of the program to a lower version.

2. Engineering Analysis

Is the MFC project file structure in a high-version IDE environment. Where COM.C and com.h are serial port-related files, these two files belong to the MFC framework added outside the custom file (class), for such files can be directly in the target project to add, resource.h and *.rc files are related to resources (such as: window, button, progress bar, etc.), Where resource.h contains the IDs of various controls (buttons, Windows, progress bars, and so on), everyone who knows MFC knows that the logical part is invoking resources through these IDs. This kind of resource transplant to be cautious, the following will focus on some of the error point, and finally the XXXXDlg.cpp or XXXXDlg.h part, which is the main logical part, including the. h variables and member function declarations,. cpp in the ON_XXX message response functions and custom member functions, such a transplant is also prudent.

3. Transplant process

First download a My Green VC6.0 Enterprise Edition: Http://pan.baidu.com/s/1mgIAGi8

Then create a new MFC dialog with the same name project, notice the same class name and DLG name!

Then directly add COM related files to the project; resource.h the macro definition of the intermediate ID can be replaced directly with the *.rc file. Dlg.h is also a comparison of the replacement, it is easier to see what to add, the member functions added in Dlg.cpp can be copied directly into, for MFC automatically generated parts, to compare the replacement (also easier to observe), especially in the Dlg.cpp Message_ Map to note is not directly copy, to be added through the Class Wizard!

See the Building Class Wizard, BUTTON1 For example: Control the original DLg.cpp file in Map on_bn_clicked (...) is set to the target project's control binding message. When a message is bound, the IDE automatically adds a gray line above it and generates the MSG's response function onbuclickedbutton1linkcom somewhere below the same file, where you need to put the code snippet for the response in the original project into the corresponding response function.

Finally, simply line up the wrong, basically like the above small MFC project transplant and I write this blog spend the same thing. Far less than you download a high version of VS then install run come fast, thank you ~

@beautifulzzzz 2015-12-30 continue~

[MFC] VS2013 version of MFC works ported to VC6.0

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.