Click here to Skip to main content
15,921,840 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionNon display characters for selection count Pin
ForNow8-Mar-16 19:44
ForNow8-Mar-16 19:44 
AnswerRe: Non display characters for selection count Pin
Richard MacCutchan8-Mar-16 21:45
mveRichard MacCutchan8-Mar-16 21:45 
GeneralRe: Non display characters for selection count Pin
ForNow9-Mar-16 3:55
ForNow9-Mar-16 3:55 
GeneralRe: Non display characters for selection count Pin
David Crow9-Mar-16 4:24
David Crow9-Mar-16 4:24 
GeneralRe: Non display characters for selection count Pin
ForNow9-Mar-16 4:32
ForNow9-Mar-16 4:32 
QuestionRe: Non display characters for selection count Pin
David Crow9-Mar-16 4:49
David Crow9-Mar-16 4:49 
AnswerRe: Non display characters for selection count Pin
ForNow9-Mar-16 4:58
ForNow9-Mar-16 4:58 
QuestionRe: Non display characters for selection count Pin
David Crow9-Mar-16 5:03
David Crow9-Mar-16 5:03 
AnswerRe: Non display characters for selection count Pin
ForNow9-Mar-16 5:20
ForNow9-Mar-16 5:20 
GeneralRe: Non display characters for selection count Pin
David Crow9-Mar-16 5:40
David Crow9-Mar-16 5:40 
GeneralRe: Non display characters for selection count Pin
ForNow9-Mar-16 5:45
ForNow9-Mar-16 5:45 
QuestionRe: Non display characters for selection count Pin
David Crow9-Mar-16 5:53
David Crow9-Mar-16 5:53 
AnswerRe: Non display characters for selection count Pin
ForNow9-Mar-16 6:21
ForNow9-Mar-16 6:21 
GeneralRe: Non display characters for selection count Pin
Richard MacCutchan9-Mar-16 6:18
mveRichard MacCutchan9-Mar-16 6:18 
GeneralRe: Non display characters for selection count Pin
Bram van Kampen9-Mar-16 14:52
Bram van Kampen9-Mar-16 14:52 
GeneralRe: Non display characters for selection count Pin
Richard MacCutchan9-Mar-16 22:11
mveRichard MacCutchan9-Mar-16 22:11 
GeneralRe: Non display characters for selection count Pin
Bram van Kampen9-Mar-16 14:49
Bram van Kampen9-Mar-16 14:49 
GeneralRe: Non display characters for selection count Pin
Richard MacCutchan9-Mar-16 22:11
mveRichard MacCutchan9-Mar-16 22:11 
GeneralRe: Non display characters for selection count Pin
Bram van Kampen10-Mar-16 14:19
Bram van Kampen10-Mar-16 14:19 
QuestionRe: Non display characters for selection count Pin
David Crow10-Mar-16 2:48
David Crow10-Mar-16 2:48 
AnswerRe: Non display characters for selection count Pin
leon de boer15-Mar-16 20:22
leon de boer15-Mar-16 20:22 
Questionconfused in static member function of class. Pin
Member 87269408-Mar-16 19:01
Member 87269408-Mar-16 19:01 
AnswerRe: confused in static member function of class. Pin
Richard MacCutchan8-Mar-16 21:37
mveRichard MacCutchan8-Mar-16 21:37 
GeneralRe: confused in static member function of class. Pin
Member 872694014-Mar-16 19:19
Member 872694014-Mar-16 19:19 
QuestionAssertion failure While Editing CTreeView Label. Pin
shanmugarajaa8-Mar-16 9:04
shanmugarajaa8-Mar-16 9:04 
Dear Friend,

After adding all necessary message handler to support to edit label in CTreeView

C#
void CMyTreeView::OnBeginLabelEdit( NMHDR* /*pNMHDR*/, LRESULT* pResult)
{
	// This is the Limit the size of the Tag Name to 127
	CTreeCtrl &ctlFiles = GetTreeCtrl();
	ctlFiles.GetEditControl()->LimitText( 127 );
	*pResult = 0;
}

void CMyTreeView::OnEndLabelEdit( NMHDR * pNMHDR, LRESULT *  pResult )
{
	*pResult = TRUE;
}

BOOL CMyTreeView::PreTranslateMessage(MSG* pMsg)
{

	if ( pMsg->message == WM_KEYDOWN )
	{
		CTreeCtrl &ctlFiles = GetTreeCtrl();
		CEdit* edit = ctlFiles.GetEditControl();
		if (edit)
		{
			if( GetKeyState( VK_CONTROL ) && pMsg->wParam == VK_C )
			{
				edit->Copy();
				return TRUE;
			}
			if( GetKeyState( VK_CONTROL ) && pMsg->wParam == VK_V )
			{
				edit->Paste();
				return TRUE;
			}
			if( GetKeyState( VK_CONTROL ) && pMsg->wParam == VK_X )
			{
				edit->Cut();
				return TRUE;
			}
			if( GetKeyState( VK_CONTROL ) && pMsg->wParam == VK_Z )
			{
				edit->Undo();
				return TRUE;
			}
			if( pMsg->wParam == VK_RETURN || pMsg->wParam == VK_ESCAPE || pMsg->wParam == VK_CONTROL || pMsg->wParam == VK_INSERT )
			{
				edit->SendMessage(WM_KEYDOWN, pMsg->wParam, pMsg->lParam);
				return TRUE;
			}
		}
	}
	return CTreeView::PreTranslateMessage(pMsg);
}


If I press a character 'a' to 'z' and 'A' to 'z' then MFC throwing Assertion.

I don't know what I am missing out to avoid this issue.
Kindly help me on this.

Thanks,
S Shanmuga Raja

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.