
Custom properties not holding
Just add an entry for it using PROP_ENTRY to a proeprty map (between
BEGIN_PROP_MAP and END_PROP_MAP). If you created a control with Wizard,
property map is created for you and comments show how to add your entries to
it.
--
With best wishes,
Igor Tandetnik
Salutation,
How do you make your custom properties persistent so that they keep their
values
when i close the current workspace?
I have a composite control and i have added one custom property (iNbrCol)
////////////////////////////////////////////////////////////////
// CmyList
class ATL_NO_VTABLE CmyList :
public CComObjectRootEx<CComSingleThreadModel>,
...
{
...
public:
int iNbrCol;
Quote:
}
STDMETHODIMP CmyList::get_NbrCol(long *pVal)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
*pVal = iNbrCol;
return S_OK;
Quote:
}
STDMETHODIMP CmyList::put_NbrCol(long newVal)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
iNbrCol = newVal;
SetDirty(true);
SendOnDataChange(0);
return S_OK;
Quote:
}
Now the value i set for this property will hold as long as i am in design
time.
Once i close the project and open it again the default value of 0 keeps
coming
back.
Obviously i need to serialize my new property (somehow).
How can i do that?
Any sample for a composite control in MSDN? (couldn't find one)
Thank you in advance,
Francois Belair