What should I do?
-
About several weeks I tried to learn MFC,but unfortunately failed to do so. At first I was confident ,but then I got frustrated 、confused and didn't know what to do. I think I've known C++ well,and know something about computer organization and operating system .But I just could copy the same codes as described in the books,even cannot change a bit. I didn't know exactly what the code means,and could nou find the ways.Is it googbye to the MFC world? I wonder.... Hope for help.:((
-
About several weeks I tried to learn MFC,but unfortunately failed to do so. At first I was confident ,but then I got frustrated 、confused and didn't know what to do. I think I've known C++ well,and know something about computer organization and operating system .But I just could copy the same codes as described in the books,even cannot change a bit. I didn't know exactly what the code means,and could nou find the ways.Is it googbye to the MFC world? I wonder.... Hope for help.:((
If you can not write your code so you are faint on MFC and need to more work of course codeproject has articles about MFC and its controls but I suggest see codes that has beginner on their titles, do you know c++ very well for example Object Oriented Programming (inheritance,Polymorphism) and Type Casting,Preprocessor directives, Input/Output,Arrays,Pointers Dynamic Memory and other things,but I didnt understand you cant change codes on books?
-
About several weeks I tried to learn MFC,but unfortunately failed to do so. At first I was confident ,but then I got frustrated 、confused and didn't know what to do. I think I've known C++ well,and know something about computer organization and operating system .But I just could copy the same codes as described in the books,even cannot change a bit. I didn't know exactly what the code means,and could nou find the ways.Is it googbye to the MFC world? I wonder.... Hope for help.:((
-
About several weeks I tried to learn MFC,but unfortunately failed to do so. At first I was confident ,but then I got frustrated 、confused and didn't know what to do. I think I've known C++ well,and know something about computer organization and operating system .But I just could copy the same codes as described in the books,even cannot change a bit. I didn't know exactly what the code means,and could nou find the ways.Is it googbye to the MFC world? I wonder.... Hope for help.:((
If you really want to learn MFC, then you really need to understand Windows programming. Start with the basics. Get the book "Programming Windows" by Charles Petzold or an equivalent. Make sure you understand Windows Messaging, the basics of Win32 APIs, etc. MFC will make a lot more sense if you understand what's going on. Just my opinion, Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
About several weeks I tried to learn MFC,but unfortunately failed to do so. At first I was confident ,but then I got frustrated 、confused and didn't know what to do. I think I've known C++ well,and know something about computer organization and operating system .But I just could copy the same codes as described in the books,even cannot change a bit. I didn't know exactly what the code means,and could nou find the ways.Is it googbye to the MFC world? I wonder.... Hope for help.:((
One thing I made when I started with MFC was, after reading some online manuals and articles of codeproject, started a MFC-Win32 application with the wizard of VC++ 6.0. Then, just with the 5 classes created (CMyApp, CMyDoc, CMyView, CMainFrm, CChildFrm), I used the class wizard to call almost all messages in every class. Just putting an AfxMessageBox ("(Funct Nr XX) The function XXXX is being called") and just played with the windows up and down, clicking, opening docs, closing docs, destroying windows, resizing... all what I could do with empty code. Afterwards, when I more or less knew the order in which functions are called. I put some break points here and there. When the debug stays in a break point, you get a step towards with F10, but if you use F11, the step is towards (but going INTO the called code). I mean.
BOOL CMyApp::InitInstance ( )
{//Some code
if (!ProcessShellCommand(cmdInfo)) //<<<----- Break point here return FALSE; // Das Hauptfenster ist initialisiert und kann jetzt angezeigt und aktualisiert werden. pMainFrame->ShowWindow(m\_nCmdShow | SW\_SHOWMAXIMIZED); pMainFrame->UpdateWindow();
}
When compile, it stops at the
if
. If you use F10, it will go topMainFrame->ShowWindow (...);
(next line in the same layer). But if you use F11 insteads, then you will go to the next step in a deeper layer:// This is a part of the Microsoft Foundation Classes C++ library.
// Copyright (C) 1992-1998 Microsoft Corporation
// All rights reserved.BOOL CWinApp::ProcessShellCommand(CCommandLineInfo& rCmdInfo)
{
BOOL bResult = TRUE;
switch (rCmdInfo.m_nShellCommand)
{
case CCommandLineInfo::FileNew:
if (!AfxGetApp()->OnCmdMsg(ID_FILE_NEW, 0, NULL, NULL))
OnFileNew();
if (m_pMainWnd == NULL)
bResult = FALSE;
break;
//more code
}That is part of the hidden code that you don't usually see. Maybe this is not the best way to learn it correctly, but for me was ok to have a global idea (seeing more or less how the functions are distributed and reading the comments from Microsoft in the code). And after I went deeper in contents as I needed new things.
Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you ;)
-
About several weeks I tried to learn MFC,but unfortunately failed to do so. At first I was confident ,but then I got frustrated 、confused and didn't know what to do. I think I've known C++ well,and know something about computer organization and operating system .But I just could copy the same codes as described in the books,even cannot change a bit. I didn't know exactly what the code means,and could nou find the ways.Is it googbye to the MFC world? I wonder.... Hope for help.:((
You're throwing in the towel only after a couple of weeks of learning MFC? Amazing! I've still not got it all figured after 15 years. Maybe I'm just stubborn.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne