Click here to Skip to main content
16,005,162 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhow do you get the index of a row in a list control Pin
king'ori21-Oct-07 2:11
king'ori21-Oct-07 2:11 
AnswerRe: how do you get the index of a row in a list control Pin
Hamid_RT21-Oct-07 2:22
Hamid_RT21-Oct-07 2:22 
AnswerRe: how do you get the index of a row in a list control Pin
lgbean21-Oct-07 9:40
lgbean21-Oct-07 9:40 
QuestionWhat should I do? Pin
bornunique21-Oct-07 1:33
bornunique21-Oct-07 1:33 
AnswerRe: What should I do? Pin
Hamid_RT21-Oct-07 1:58
Hamid_RT21-Oct-07 1:58 
AnswerRe: What should I do? Pin
Johpoke21-Oct-07 2:22
Johpoke21-Oct-07 2:22 
AnswerRe: What should I do? Pin
Mark Salsbery21-Oct-07 7:27
Mark Salsbery21-Oct-07 7:27 
AnswerRe: What should I do? Pin
Nelek21-Oct-07 20:29
protectorNelek21-Oct-07 20:29 
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 to pMainFrame->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

Wink | ;)

AnswerRe: What should I do? Pin
David Crow22-Oct-07 5:16
David Crow22-Oct-07 5:16 
QuestionMFC focus question Pin
FredrickNorge21-Oct-07 0:14
FredrickNorge21-Oct-07 0:14 
AnswerRe: MFC focus question Pin
Mark Salsbery21-Oct-07 7:40
Mark Salsbery21-Oct-07 7:40 
GeneralRe: MFC focus question Pin
FredrickNorge21-Oct-07 11:12
FredrickNorge21-Oct-07 11:12 
AnswerRe: MFC focus question Pin
Stephen Hewitt21-Oct-07 19:40
Stephen Hewitt21-Oct-07 19:40 
GeneralRe: MFC focus question Pin
FredrickNorge21-Oct-07 21:45
FredrickNorge21-Oct-07 21:45 
Questiontrim heading and trailing space Pin
George_George20-Oct-07 21:52
George_George20-Oct-07 21:52 
AnswerRe: trim heading and trailing space Pin
Christian Graus20-Oct-07 23:40
protectorChristian Graus20-Oct-07 23:40 
GeneralRe: trim heading and trailing space Pin
George_George21-Oct-07 3:18
George_George21-Oct-07 3:18 
AnswerRe: trim heading and trailing space Pin
henk21cm20-Oct-07 23:46
henk21cm20-Oct-07 23:46 
GeneralRe: trim heading and trailing space Pin
George_George21-Oct-07 3:16
George_George21-Oct-07 3:16 
QuestionFile read problem Pin
pri_skit20-Oct-07 20:05
pri_skit20-Oct-07 20:05 
AnswerRe: File read problem Pin
karle20-Oct-07 21:36
karle20-Oct-07 21:36 
AnswerRe: File read problem Pin
KEL322-Oct-07 1:49
KEL322-Oct-07 1:49 
QuestionRe: File read problem Pin
David Crow22-Oct-07 5:25
David Crow22-Oct-07 5:25 
QuestionRe: File read problem Pin
David Crow22-Oct-07 5:28
David Crow22-Oct-07 5:28 
AnswerRe: File read problem Pin
KEL322-Oct-07 22:00
KEL322-Oct-07 22:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.