-
October 5th, 2012, 12:39 PM
#1
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
-
October 6th, 2012, 07:54 AM
#2
Re: Child dialog shadow remains
Could you post some code?
Victor Nijegorodov
-
October 6th, 2012, 10:52 AM
#3
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
-
October 9th, 2012, 01:43 AM
#4
Re: Child dialog shadow remains
Please reply if the sample code is helpful to answer.
-
October 9th, 2012, 02:00 AM
#5
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.
-
October 9th, 2012, 02:07 AM
#6
Re: Child dialog shadow remains
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.
Best regards,
Igor
-
October 9th, 2012, 03:43 AM
#7
Re: Child dialog shadow remains
child dialog shadow... when i made some settings change in child dialog & click OK shadow remains.
-
October 9th, 2012, 03:56 AM
#8
Re: Child dialog shadow remains
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:
Originally Posted by Igor Vartanov
What is shadow here? What is editing?
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?
Victor Nijegorodov
-
October 9th, 2012, 04:09 AM
#9
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.
-
October 9th, 2012, 04:17 AM
#10
Re: Child dialog shadow remains
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?
Victor Nijegorodov
-
October 9th, 2012, 04:18 AM
#11
Re: Child dialog shadow remains
Did you try something like this?
Code:
m_ctrlColumnViewList.Invalidate();
-
October 9th, 2012, 05:54 AM
#12
Re: Child dialog shadow remains
m_ctrlColumnViewList.Invalidate(); Doesn't work
-
October 9th, 2012, 06:19 AM
#13
Re: Child dialog shadow remains
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?
Victor Nijegorodov
-
October 9th, 2012, 06:29 AM
#14
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
-
October 9th, 2012, 06:41 AM
#15
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
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|