A
AShe
I write my own add-in for Outlook 2007 with С++ and ATL, and create property
page for it. All works fine (property page shown), but when I change some
textbox's text on property page 'Apply' button is not enabled.
MSDN says for 'PropertyPage.Dirty': "The ActiveX control that implements the
PropertyPage object sets the value of this property, and Microsoft Outlook
queries this in response to the OnStatusChange method of a PropertyPageSite
object."
When I change some text on property page, my function 'SetPageDirty' launch.
It's code:
void CMyPropPage::SetPageDirty(void)
{
m_bIsDirty = true;
IOleClientSite* ppClientSite;
HRESULT hr = this->GetClientSite(&ppClientSite);
if (FAILED(hr))
{
ATLTRACE2(L"Failed GetClientSite\r\n");
return;
}
CComQIPtr<Outlook:ropertyPageSite> spPropPageSite(ppClientSite);
if (spPropPageSite != NULL)
{
hr = spPropPageSite->OnStatusChange();
if (FAILED(hr))
{
ATLTRACE2(L"Failed OnStatusChange\r\n");
}
}
}
This function works fine (no trace outputs), but Outlook not try to query
'Dirty' property. It's code:
STDMETHODIMP CMyPropPage::get_Dirty(VARIANT_BOOL * Dirty)
{
*Dirty = (m_bIsDirty) ? VARIANT_TRUE : VARIANT_FALSE;
return S_OK;
}
I have breakpoint on first line of 'get_Dirty' and it's not hitting. And
'Apply' button still disabled. What I'm doing wrong?
page for it. All works fine (property page shown), but when I change some
textbox's text on property page 'Apply' button is not enabled.
MSDN says for 'PropertyPage.Dirty': "The ActiveX control that implements the
PropertyPage object sets the value of this property, and Microsoft Outlook
queries this in response to the OnStatusChange method of a PropertyPageSite
object."
When I change some text on property page, my function 'SetPageDirty' launch.
It's code:
void CMyPropPage::SetPageDirty(void)
{
m_bIsDirty = true;
IOleClientSite* ppClientSite;
HRESULT hr = this->GetClientSite(&ppClientSite);
if (FAILED(hr))
{
ATLTRACE2(L"Failed GetClientSite\r\n");
return;
}
CComQIPtr<Outlook:ropertyPageSite> spPropPageSite(ppClientSite);
if (spPropPageSite != NULL)
{
hr = spPropPageSite->OnStatusChange();
if (FAILED(hr))
{
ATLTRACE2(L"Failed OnStatusChange\r\n");
}
}
}
This function works fine (no trace outputs), but Outlook not try to query
'Dirty' property. It's code:
STDMETHODIMP CMyPropPage::get_Dirty(VARIANT_BOOL * Dirty)
{
*Dirty = (m_bIsDirty) ? VARIANT_TRUE : VARIANT_FALSE;
return S_OK;
}
I have breakpoint on first line of 'get_Dirty' and it's not hitting. And
'Apply' button still disabled. What I'm doing wrong?