Click here to Skip to main content
15,890,506 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: GetFileToSave and Windows 7 Pin
David Crow24-Mar-10 2:53
David Crow24-Mar-10 2:53 
AnswerRe: GetFileToSave and Windows 7 Pin
Psychopasta24-Mar-10 5:42
Psychopasta24-Mar-10 5:42 
QuestionRichEdit wrong list numbering with letters Pin
wp7323-Mar-10 8:55
wp7323-Mar-10 8:55 
AnswerRe: RichEdit wrong list numbering with letters Pin
wp7324-Mar-10 3:15
wp7324-Mar-10 3:15 
Questionproblem displaying unicode filenames in a list box Pin
sashoalm23-Mar-10 7:25
sashoalm23-Mar-10 7:25 
AnswerRe: problem displaying unicode filenames in a list box Pin
Eugen Podsypalnikov23-Mar-10 22:19
Eugen Podsypalnikov23-Mar-10 22:19 
QuestionSimple Treeview in MFC 2008 Pin
D.Manivelan23-Mar-10 3:54
D.Manivelan23-Mar-10 3:54 
AnswerRe: Simple Treeview in MFC 2008 Pin
Maximilien23-Mar-10 4:12
Maximilien23-Mar-10 4:12 
Create a new project (either MDI or SDI) with the wizard and at one of the last step of the wizard, you can select what type of view you want to use as the default view of your application.

or, if you already have an application with a default CView class, you could create a CTreeCtrl object in the view and use it.

for example :
class YourView : public CView
{
  // lots of default stuff...
  
  CTreeCtrl m_YouTree;
  afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct );
  afx_msg void OnSize(UINT nType, int cx, int cy);

};


and
int YourView::OnCreate(LPCREATESTRUCT lpCreateStruct )
{
	if (CView::OnCreate(lpCreateStruct) == -1)
		return -1;

	CRect rect;
	GetClientRect(rect);
	m_Tree.Create(WS_CHILD|WS_VISIBLE, rect, this, 1234);

	m_Tree.InsertItem(_T("root"), TVI_ROOT);

	return 0;
}

void YourView::OnSize(UINT nType, int cx, int cy)
{
	if ( m_Tree.GetSafeHwnd() )
	{
		CRect rect;
		GetClientRect(rect);
		m_Tree.MoveWindow(rect);
	}
}

Max.
Watched code never compiles.

AnswerRe: Simple Treeview in MFC 2008 Pin
Iain Clarke, Warrior Programmer23-Mar-10 8:33
Iain Clarke, Warrior Programmer23-Mar-10 8:33 
QuestionStaticly linking MFC in VS2008 app produces compiling errors Pin
josip cagalj22-Mar-10 23:03
josip cagalj22-Mar-10 23:03 
AnswerRe: Staticly linking MFC in VS2008 app produces compiling errors Pin
CPallini22-Mar-10 23:26
mveCPallini22-Mar-10 23:26 
GeneralRe: Staticly linking MFC in VS2008 app produces compiling errors Pin
josip cagalj23-Mar-10 0:02
josip cagalj23-Mar-10 0:02 
GeneralRe: Staticly linking MFC in VS2008 app produces compiling errors Pin
CPallini23-Mar-10 0:07
mveCPallini23-Mar-10 0:07 
GeneralRe: Staticly linking MFC in VS2008 app produces compiling errors [modified] Pin
josip cagalj23-Mar-10 0:31
josip cagalj23-Mar-10 0:31 
AnswerRe: Staticly linking MFC in VS2008 app produces compiling errors Pin
KarstenK23-Mar-10 4:12
mveKarstenK23-Mar-10 4:12 
GeneralRe: Staticly linking MFC in VS2008 app produces compiling errors Pin
josip cagalj23-Mar-10 4:51
josip cagalj23-Mar-10 4:51 
AnswerRe: Staticly linking MFC in VS2008 app produces compiling errors Pin
Avi Berger23-Mar-10 6:02
Avi Berger23-Mar-10 6:02 
GeneralRe: Staticly linking MFC in VS2008 app produces compiling errors Pin
josip cagalj23-Mar-10 21:37
josip cagalj23-Mar-10 21:37 
QuestionHow to convert Chinese Unicode string to ANSI multibyte? Pin
tmx22-Mar-10 22:56
tmx22-Mar-10 22:56 
AnswerRe: How to convert Chinese Unicode string to ANSI multibyte? Pin
Richard MacCutchan23-Mar-10 0:28
mveRichard MacCutchan23-Mar-10 0:28 
GeneralRe: How to convert Chinese Unicode string to ANSI multibyte? Pin
tmx24-Mar-10 21:47
tmx24-Mar-10 21:47 
QuestionReg MDI windows Explorer Pin
hellogany22-Mar-10 20:45
hellogany22-Mar-10 20:45 
AnswerRe: Reg MDI windows Explorer Pin
Richard MacCutchan22-Mar-10 22:16
mveRichard MacCutchan22-Mar-10 22:16 
AnswerRe: Reg MDI windows Explorer Pin
Adam Roderick J23-Mar-10 2:19
Adam Roderick J23-Mar-10 2:19 
GeneralRe: Reg MDI windows Explorer Pin
hellogany23-Mar-10 18:40
hellogany23-Mar-10 18:40 

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.