المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : How can I close an CChildFrame from CHtmlView ?



C++ Programming
12-05-2009, 07:12 AM
I have an MDI application with CHtmlView. In CInvoiceHtmlView::OnBeforeNavigate2(...)I see if a special button is pressed. When is pressed , I would like to close child frame , but I don't know where I do that ...
Here is my trials :


void CInvoiceHtmlView::OnBeforeNavigate2(LPCTSTR lpszURL, DWORD nFlags, LPCTSTR lpszTargetFrameName, CByteArray& baPostedData, LPCTSTR lpszHeaders, BOOL* pbCancel)
{
// TODO: Add your specialized code here and/or call the base class

if(m_bProcessNavigate) // set not very first time
{
CString sBytes;

if(baPostedData.GetSize())
{
for(int i = 0;i < baPostedData.GetSize();i++)sBytes += (char)baPostedData[i];
}

sBytes = sBytes.Left(7);
if(sBytes == "button2")m_bClose = TRUE;
}

CHtmlView::OnBeforeNavigate2(lpszURL, nFlags, lpszTargetFrameName, baPostedData, lpszHeaders, pbCancel);
}

now : m_bClose show me if special button was fired , but I don't know how can I use this to close child window ...