Click here to Skip to main content
15,902,447 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionPointer Casting warning Pin
Software200715-Sep-11 8:57
Software200715-Sep-11 8:57 
QuestionRe: Pointer Casting warning Pin
David Crow15-Sep-11 9:08
David Crow15-Sep-11 9:08 
AnswerRe: Pointer Casting warning Pin
Software200715-Sep-11 9:36
Software200715-Sep-11 9:36 
AnswerRe: Pointer Casting warning Pin
krmed15-Sep-11 10:04
krmed15-Sep-11 10:04 
GeneralRe: Pointer Casting warning Pin
Software200715-Sep-11 10:17
Software200715-Sep-11 10:17 
AnswerRe: Pointer Casting warning Pin
Chuck O'Toole15-Sep-11 10:53
Chuck O'Toole15-Sep-11 10:53 
AnswerRe: Pointer Casting warning Pin
tushar_patil20-Sep-11 20:57
tushar_patil20-Sep-11 20:57 
QuestionCTreeView classname Pin
_Flaviu15-Sep-11 8:21
_Flaviu15-Sep-11 8:21 
I need to know if focus is on a treeview, and I try it in follow way :
C++
BOOL CMainFrame::IsTreeView(CWnd* pWnd)
{
	ASSERT(pWnd != NULL);

	HWND hWnd = pWnd->GetSafeHwnd();
	if(hWnd == FALSE)return FALSE;

	TCHAR szClassName[10];

	return ::GetClassName(hWnd, szClassName, 10) && _tcsicmp(szClassName, _T("TreeView")) == 0;
}

but didn't work it ... what I've do wrong ? Thanks.

In fact, I need to enable an menu item, if I got focus on a treeview window :
C++
void CMainFrame::OnUpdateEditNewItemMenu(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here

	CWnd* pWnd = GetFocus();
	pCmdUI->Enable(IsTreeView(pWnd));
}

void CMainFrame::OnEditNewItemMenu() 
{
	// TODO: Add your command handler code here
	MessageBox(_T("aaaa"));
}

AnswerRe: CTreeView classname Pin
_Flaviu15-Sep-11 9:00
_Flaviu15-Sep-11 9:00 
AnswerRe: CTreeView classname Pin
etherCao17-Sep-11 12:44
etherCao17-Sep-11 12:44 
QuestionDLL native win32 variables lifetime? Pin
skaboFer15-Sep-11 3:28
skaboFer15-Sep-11 3:28 
AnswerRe: DLL native win32 variables lifetime? Pin
MicroVirus15-Sep-11 3:57
MicroVirus15-Sep-11 3:57 
AnswerRe: DLL native win32 variables lifetime? Pin
Erudite_Eric15-Sep-11 4:08
Erudite_Eric15-Sep-11 4:08 
AnswerRe: DLL native win32 variables lifetime? Pin
Richard MacCutchan15-Sep-11 4:17
mveRichard MacCutchan15-Sep-11 4:17 
GeneralRe: DLL native win32 variables lifetime? Pin
skaboFer15-Sep-11 4:35
skaboFer15-Sep-11 4:35 
GeneralRe: DLL native win32 variables lifetime? Pin
Richard MacCutchan15-Sep-11 5:42
mveRichard MacCutchan15-Sep-11 5:42 
GeneralRe: DLL native win32 variables lifetime? Pin
skaboFer15-Sep-11 5:53
skaboFer15-Sep-11 5:53 
QuestionLibrary Usage Problem Pin
AmbiguousName14-Sep-11 23:06
AmbiguousName14-Sep-11 23:06 
AnswerRe: Library Usage Problem Pin
Erudite_Eric14-Sep-11 23:19
Erudite_Eric14-Sep-11 23:19 
AnswerRe: Library Usage Problem Pin
MicroVirus15-Sep-11 3:47
MicroVirus15-Sep-11 3:47 
GeneralRe: Library Usage Problem Pin
Erudite_Eric15-Sep-11 22:13
Erudite_Eric15-Sep-11 22:13 
GeneralRe: Library Usage Problem Pin
Albert Holguin16-Sep-11 3:59
professionalAlbert Holguin16-Sep-11 3:59 
GeneralRe: Library Usage Problem Pin
MicroVirus16-Sep-11 4:40
MicroVirus16-Sep-11 4:40 
GeneralRe: Library Usage Problem Pin
Erudite_Eric16-Sep-11 4:49
Erudite_Eric16-Sep-11 4:49 
GeneralRe: Library Usage Problem Pin
MicroVirus16-Sep-11 12:16
MicroVirus16-Sep-11 12:16 

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.