CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Join Date
    Oct 2012
    Posts
    7

    Red face Child dialog shadow remains

    Hi, this is my first post.

    Work flow is like this:
    i open child dialog from a dialog( which is launched from a toolbar of a window) after editing i close the child dialog, after closing child dialog shadow is retained on window but not on the parent dialog. Later when i close the parent dialog the child dialog shadow disappears.
    (issue exist only when i edit in child dialog)

    Thanks a lot,
    Shivaraj

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Child dialog shadow remains

    Could you post some code?
    Victor Nijegorodov

  3. #3
    Join Date
    Oct 2012
    Posts
    7

    Re: Child dialog shadow remains

    Below used OnModifyview dialog is child dialog of a dialog.

    Code:
    void CSelectColumnViewDlg::OnModifyview() 
    {
    	int iIndex = m_ctrlColumnViewList.GetCurSel();
    	if (iIndex < 0)
    		return;
    	double dViewId = m_ctrlColumnViewList.GetItemDataDouble(iIndex);
    	if (dViewId == 0.0)
    		return;
    	CWaitCursor wait;
    	CComPtr<IDispatch> pDispColumnView;
    	CComPtr<ITrackingDataManager> pManager;
    	pManager.CoCreateInstance(CLSID_TrackingDataManager);
    	if (pManager)
    		pManager->GetColumnView(dViewId, &pDispColumnView);
    	CComQIPtr<ITrackingColumnView> pColumnView(pDispColumnView);
    	if (pColumnView == NULL)
    		return;
    	CModifyColumnViewDlg dlg;
    	dlg.SetColumnView(pColumnView);
    	dlg.SetType(m_lSolution, m_lListType);
    	dlg.SetTrackGroupCd(m_dTrackGroupCd);
    	std::set<CString>* pExistingNames = GetExistingNames(iIndex);
    	dlg.SetExistingNames(pExistingNames);
    	if (dlg.DoModal() == IDOK)
    	{	//Issue exist only when i edit in child dialog & click above OK (child dialog OK)		
    		
    		HWND hWndAncestor = ::GetAncestor(GetSafeHwnd(), GA_ROOT);
    		
    		//hWndAncestor->Invalidate();  //not working
    		//InvalidateRect(hWndAncestor, NULL, TRUE);  //not working
    		//::RedrawWindow(hWndAncestor,NULL,NULL,RDW_INVALIDATE);  //not working
    		//::UpdateWindow(hWndAncestor);  //not working
    		
    
    		m_ctrlColumnViewList.DeleteString(iIndex);
    		
    		CComBSTR bstrName;
    		pColumnView->get_Name(&bstrName);
    		int iIndex = m_ctrlColumnViewList.AddString(CString(bstrName));
    		m_ctrlColumnViewList.SetItemDataDouble(iIndex, dViewId);
    		m_ctrlColumnViewList.SetCurSel(iIndex);
    		
    		//Invalidate();  //not working
    		//RedrawWindow();	//not working
    
    	}
    	if (pExistingNames)
    		delete pExistingNames;
    	Invalidate();
    	//OnPaint();  //not working
    	//RedrawWindow();// not working
    }
    Last edited by Marc G; October 9th, 2012 at 02:00 AM. Reason: Added code tags

  4. #4
    Join Date
    Oct 2012
    Posts
    7

    Re: Child dialog shadow remains

    Please reply if the sample code is helpful to answer.

  5. #5
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150

    Re: Child dialog shadow remains

    [ added code tags]

    Please use them when posting code snippets.

    Can you make a screenshot of the problem? I'm not quite sure I understand what is happening.
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

  6. #6
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: Child dialog shadow remains

    Quote Originally Posted by shivaraj View Post
    after editing i close the child dialog, after closing child dialog shadow is retained on window but not on the parent dialog. Later when i close the parent dialog the child dialog shadow disappears.
    What is shadow here? What is editing?

    And could you use [code][/code] tags for code snippets.
    Best regards,
    Igor

  7. #7
    Join Date
    Oct 2012
    Posts
    7

    Re: Child dialog shadow remains

    child dialog shadow... when i made some settings change in child dialog & click OK shadow remains.

  8. #8
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Child dialog shadow remains

    Quote Originally Posted by shivaraj View Post
    child dialog shadow... when i made some settings change in child dialog & click OK shadow remains.
    Please, don't repeat the same words that do not bring any useful info about the problem!

    Please, answer the following questions:
    Quote Originally Posted by Igor Vartanov View Post
    What is shadow here? What is editing?
    Quote Originally Posted by Marc G View Post
    [ added code tags]Can you make a screenshot of the problem? I'm not quite sure I understand what is happening.
    What exactly does CModifyColumnViewDlg dialog do? Do you have its code implementation?
    Victor Nijegorodov

  9. #9
    Join Date
    Oct 2012
    Posts
    7

    Re: Child dialog shadow remains

    editing in the sense i am going change some settings through this child dialog.
    Shadow means patch in the place of child dialog.

  10. #10
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Child dialog shadow remains

    Quote Originally Posted by shivaraj View Post
    editing in the sense i am going change some settings through this child dialog.
    Shadow means patch in the place of child dialog.
    And where is a screenshot?
    And what about CModifyColumnViewDlg dialog?
    Victor Nijegorodov

  11. #11
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150

    Re: Child dialog shadow remains

    Did you try something like this?
    Code:
    m_ctrlColumnViewList.Invalidate();
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

  12. #12
    Join Date
    Oct 2012
    Posts
    7

    Re: Child dialog shadow remains

    Name:  a.png
Views: 1277
Size:  38.1 KB
    m_ctrlColumnViewList.Invalidate(); Doesn't work

  13. #13
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Child dialog shadow remains

    Quote Originally Posted by shivaraj View Post
    Below used OnModifyview dialog is child dialog of a dialog.

    Code:
    ...
    	CModifyColumnViewDlg dlg;
    	dlg.SetColumnView(pColumnView);
    	dlg.SetType(m_lSolution, m_lListType);
    	dlg.SetTrackGroupCd(m_dTrackGroupCd);
    	std::set<CString>* pExistingNames = GetExistingNames(iIndex);
    	dlg.SetExistingNames(pExistingNames);
    	[B][B][COLOR="#008000"][B]if (dlg.DoModal() == IDOK)
    	{	//Issue exist only when i edit in child dialog & click above OK (child dialog OK)		
    What and how do you edit in child dialog?
    And the third time: What exactly does CModifyColumnViewDlg dialog do? Do you have its source code?
    Victor Nijegorodov

  14. #14
    Join Date
    Oct 2012
    Posts
    7

    Re: Child dialog shadow remains

    Yes i have...
    Code:
    int CModifyColumnViewDlg::DoModal() 
    {	
    	
    	if (m_pColumnView == NULL)
    		return IDCANCEL;
    	m_bSoftUpdate = true;
    	CComPtr<IDispatch> pDispFieldList;
    	m_pColumnView->get_ColumnList(&pDispFieldList);
    	if (pDispFieldList)
    		pDispFieldList->QueryInterface(IID_IFNDispatchCollection, reinterpret_cast<void**>(&m_pListFields));
    	if (m_pListFields == NULL)
    	{
    		m_pListFields.CoCreateInstance(CLSID_FNDispatchCollection);
    		if (m_pListFields == NULL)
    			return IDCANCEL;
    		m_pColumnView->put_ColumnList(m_pListFields);
    	}
    	//AfxMessageBox("within DoModal");
    	CComPtr<IDispatch> pDispSortingList;
    	m_pColumnView->get_ColumnList(&pDispSortingList);
    	if (pDispSortingList == NULL)
    	{
    		CComPtr<IFNDispatchCollection> pListSorting;
    		pListSorting.CoCreateInstance(CLSID_FNDispatchCollection);
    		if (pListSorting == NULL)
    			return IDCANCEL;
    		m_pColumnView->put_SortingList(pListSorting);
    	}
    	return CDialog::DoModal();
    }
    Last edited by Marc G; October 9th, 2012 at 06:52 AM. Reason: Added code tags

  15. #15
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Child dialog shadow remains

    1. Please, reread post#5 and post#6. You have to use Code tags while posting code snippets. Otherwise, your code is absolutely unreadable so no one will ever try to investigate it!
    2. The overridden (or overloaded)
    Code:
    CModifyColumnViewDlg::DoModal()
    has nothing to do with you problem because this part of code is executed before any of the control you are supposed to "edit" is created. Are there OnInitDialog(), OnOK() methods? Some EndDialog() calls? How do you close (exit) it?
    Victor Nijegorodov

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured