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
Re: Child dialog shadow remains
Could you post some code?
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
}
Re: Child dialog shadow remains
Please reply if the sample code is helpful to answer.
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.
Re: Child dialog shadow remains
Quote:
Originally Posted by
shivaraj
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.
Re: Child dialog shadow remains
child dialog shadow... when i made some settings change in child dialog & click OK shadow remains.
Re: Child dialog shadow remains
Quote:
Originally Posted by
shivaraj
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
What is shadow here? What is editing?
Quote:
Originally Posted by
Marc G
[ 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?
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.
Re: Child dialog shadow remains
Quote:
Originally Posted by
shivaraj
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?
Re: Child dialog shadow remains
Did you try something like this?
Code:
m_ctrlColumnViewList.Invalidate();
1 Attachment(s)
Re: Child dialog shadow remains
Attachment 30473
m_ctrlColumnViewList.Invalidate(); Doesn't work
Re: Child dialog shadow remains
Quote:
Originally Posted by
shivaraj
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?
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();
}
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?