Click here to Skip to main content
15,920,468 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Unicode Problems Pin
prasad_som21-Dec-06 20:41
prasad_som21-Dec-06 20:41 
GeneralRe: Unicode Problems Pin
kiranin21-Dec-06 20:44
kiranin21-Dec-06 20:44 
AnswerRe: Unicode Problems Pin
Johann Gerell21-Dec-06 21:22
Johann Gerell21-Dec-06 21:22 
GeneralRe: Unicode Problems [modified] Pin
CPallini21-Dec-06 22:50
mveCPallini21-Dec-06 22:50 
QuestionRe: Unicode Problems Pin
kiranin22-Dec-06 0:17
kiranin22-Dec-06 0:17 
AnswerRe: Unicode Problems Pin
CPallini22-Dec-06 2:59
mveCPallini22-Dec-06 2:59 
AnswerRe: Unicode Problems Pin
Cristian Amarie25-Dec-06 6:10
Cristian Amarie25-Dec-06 6:10 
QuestionTree Control Pin
Krishnatv21-Dec-06 20:07
Krishnatv21-Dec-06 20:07 
I have a dialogbox application having Two Edit boxes Node ID and Node Name.
and One browse Button. If i click the Browse button one Tree should open ( Iam calling another Dialogbox with Tree control ).

If i selecte any root item in the tree and double click it The selected node Name should come in the Node Name Edit Box.

Iam Ok till Now.

But I need to fill Node ID Editbox.

If i Doubleclick the Root Node Name , Then Node Id also should Fill

How can i do that ?

That Id sholdnt display in the Tree.

My code For Node Name is like this.

BOOL CTreeItem::OnInitDialog()
{
CDialog::OnInitDialog();

TVINSERTSTRUCT tvInsert;

tvInsert.hParent = NULL;
tvInsert.hInsertAfter = NULL;
tvInsert.item.mask = TVIF_TEXT;
tvInsert.item.pszText = _T("United States");


HTREEITEM hCountry = m_Tree.InsertItem(&tvInsert);



HTREEITEM hPA = m_Tree.InsertItem(TVIF_TEXT,
_T("Pennsylvania"), 0, 0, 0, 0, 0, hCountry, NULL);

// Insert the "Washington" item and assure that it is
// inserted after the "Pennsylvania" item. This override is
// more appropriate for conveniently inserting items with
// images.

HTREEITEM hWA = m_Tree.InsertItem(_T("Washington"),
0, 0, hCountry, hPA);

// We'll add some cities under each of the states.
// The override used here is most appropriate
// for inserting text-only items.

m_Tree.InsertItem(_T("Pittsburgh"), hPA, TVI_SORT);
m_Tree.InsertItem(_T("Harrisburg"), hPA, TVI_SORT);
m_Tree.InsertItem(_T("Altoona"), hPA, TVI_SORT);

m_Tree.InsertItem(_T("Seattle"), hWA, TVI_SORT);
m_Tree.InsertItem(_T("Kalaloch"), hWA, TVI_SORT);
m_Tree.InsertItem(_T("Yakima"), hWA, TVI_SORT);

return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}

void CTreeItem::OnDblclkTree1(NMHDR* pNMHDR, LRESULT* pResult)
{
HTREEITEM hItem = m_Tree.GetSelectedItem();

BOOL bFlag = m_Tree.ItemHasChildren(hItem);
if (bFlag)
{
m_strNodeName.Empty();
m_Tree.Expand(hItem, TVE_EXPAND);
}
else
{
m_strNodeName = m_Tree.GetItemText(hItem);
OnOK();
}
*pResult = 1;
}

void CTreeItem::OnOK()
{
if(m_strNodeName.IsEmpty())
{
AfxMessageBox("Select Datanode!!!");
}
else
CDialog::OnOK();
}

void CTreeItem::OnNodeSelChanged(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;

HTREEITEM hItem = m_Tree.GetSelectedItem();

if (m_Tree.ItemHasChildren(hItem))
{
m_strNodeName.Empty();
}
else
{
m_strNodeName = m_Tree.GetItemText(hItem);
}
*pResult = 0;
}







AnswerRe: Tree Control Pin
Rage21-Dec-06 22:28
professionalRage21-Dec-06 22:28 
GeneralRe: Tree Control Pin
Krishnatv21-Dec-06 22:59
Krishnatv21-Dec-06 22:59 
Questionimage capture Pin
indrajeshr21-Dec-06 20:06
indrajeshr21-Dec-06 20:06 
AnswerRe: image capture Pin
Rage21-Dec-06 22:32
professionalRage21-Dec-06 22:32 
AnswerRe: image capture Pin
Greg Daye22-Dec-06 2:59
Greg Daye22-Dec-06 2:59 
GeneralRe: image capture Pin
Mark Salsbery22-Dec-06 5:17
Mark Salsbery22-Dec-06 5:17 
GeneralRe: image capture Pin
indrajeshr25-Dec-06 23:25
indrajeshr25-Dec-06 23:25 
QuestionProblem with Repalcing a view Pin
Shraddha Gautam21-Dec-06 19:13
Shraddha Gautam21-Dec-06 19:13 
QuestionRe: Problem with Repalcing a view Pin
prasad_som21-Dec-06 20:39
prasad_som21-Dec-06 20:39 
AnswerRe: Problem with Repalcing a view Pin
Rage21-Dec-06 22:40
professionalRage21-Dec-06 22:40 
Questionis the Floppy Disk have the unique sign? Pin
jakeyjia21-Dec-06 19:10
jakeyjia21-Dec-06 19:10 
AnswerRe: is the Floppy Disk have the unique sign? Pin
kakan21-Dec-06 19:27
professionalkakan21-Dec-06 19:27 
GeneralRe: is the Floppy Disk have the unique sign? Pin
jakeyjia21-Dec-06 19:51
jakeyjia21-Dec-06 19:51 
GeneralRe: is the Floppy Disk have the unique sign? Pin
kakan21-Dec-06 20:20
professionalkakan21-Dec-06 20:20 
GeneralRe: is the Floppy Disk have the unique sign? Pin
jakeyjia21-Dec-06 20:30
jakeyjia21-Dec-06 20:30 
GeneralRe: is the Floppy Disk have the unique sign? Pin
kakan21-Dec-06 20:49
professionalkakan21-Dec-06 20:49 
QuestionBase Class of dialog Pin
zareee21-Dec-06 19:09
zareee21-Dec-06 19:09 

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.