What s the use of knowing how MFC works

Updated on technology 2024-05-11
5 answers
  1. Anonymous users2024-02-10

    IEW-derived classes have the declare dyncreate macro statement in their definitions, so you can see that these three classes are created dynamically, i.e. on heap memory with the new operator. CmainFrame creates CmainFrame in CmyWinApp::InitInstance() * PmainFrame = new CmainFrame and enters CwinApp::

    onfilenew(), which is dynamically created in cframewnd::oncreate().

    The afxgetapp() function is a global function, and its definition is not explained in detail, it is nothing more than this pointer that has been associated with the constructor of the cwinapp class, and the scope of this pointer is the constructor of cwinapp. This pointer in your program represents the pointer to the current object, and it doesn't make any difference if you call afxgetapp(). In a word, afxgetapp() is a pointer to a theapp global variable that can be used anywhere (including cmainframe and cwinapp).

    Very useful function.

  2. Anonymous users2024-02-09

    Generally speaking, when creating a single document with MFC, there will be the following classes: caboutdlg, cmainframe, cmyapp, and a very useful function reference: msdn, and in simple terms, mfc can be found in cmyapp::initinstance().

  3. Anonymous users2024-02-08

    Proficient in writing powerful and stable win32 programs.

  4. Anonymous users2024-02-07

    The so-called mechanism is the structure and principle, and the common one is the message mapping mechanism......, which works to make the program's handling of messages more convenient, straightforward, and compact.

  5. Anonymous users2024-02-06

    After all, MFC is still C++, and there is a difference, but it is not particularly big.

    One of the things that our boss often says is that the source code itself is the best annotation, and the source code is given to you, so what you can't understand.

    One of the more annoying things about MFC is that if it is not a work done by a master, it is easy to mix the business logic and interface together, and almost all the business is scattered under each dialog box, with low cohesion and high coupling.

    But even so, it's easy to see the clues.

    Let's talk about some theories and some tricks.

    First of all, you have to be familiar with the program itself, that is, you can use it, and understand what happens when each button is pressed, and where the trigger point of each business logic is.

    Figure out the function, go to linux to imitate the interface, and the buttons are laid out as they are.

    And then what happened when each button was pressed, go to the MFC source code to find it, and when you encounter a business class, you can copy the whole thing and change it a little to be able to pass the compilation, and when you encounter the interface processing, it will be converted into Linux processing.

    The whole process is a bit like the prototype mode, only it's simpler because you don't have to think about the response of each button anymore, the prototype is already designed.

    Again, patience, where there is a will, there is a way, as long as you are willing to do it, you can do it.

Related questions
2 answers2024-05-11

1. [Monthly Awards] The top 20 of the weekly "Knowing Star", the weekly "Rising Points Ranking", and the top 10 of the "Total Points Ranking" updated at 10 am on the 21st of the month. Different gifts that can be received. >>>More

6 answers2024-05-11

At present, the online governance platform is running on a pilot basis in some areas and has not spread to the whole country, but there are still many other ways to help people solve problems. >>>More

8 answers2024-05-11

Ask a reward.

.It's so-so. >>>More

3 answers2024-05-11

The wall bag is because Wing Chun is suitable for this kind of practice, Wing Chun is different from other fighting fights, it requires the opponent to be frontal, the waist is straight, and the body is balanced, while Wing Chun punches are always straight punches because of the speed. Also, Wing Chun can't squat and dodge, the emphasis is on discharging strength, using the body to rotate, transfer power, and attack at the same time, so punching sandbags is not much use for Wing Chun, but wall bags can allow practitioners to better grasp the strength of punches. >>>More

6 answers2024-05-11

The role of the current points is that the top 20 people who have risen the most points every month, the star of knowing in the last week, and the top 10 of the total points on the last day can receive different gifts, such as photoelectric mice, sweatshirts, etc., in addition, because the higher the points, it also means that you know more months, and you are diligent in your work, and you have more recognition, so the greater the psychological satisfaction and sense of accomplishment for everyone, and look at your name on the star of knowing, the total points leaderboard, I guess it's something I'm proud of. >>>More