Hi

Can anyone tell me how to write property SET function? I've created a
property and written a SET function which was to check it's new value before
being changed. The problem is that I always get an error: "reference not set
to an instance of object". What's wrong with this code?

--------property and function declaration in DISPATCH_MAP

DISP_PROPERTY_NOTIFY(CUClientXCtrl, "ServerHost", m_ServerHost,
SetServerHost, VT_BSTR)
DISP_FUNCTION(CUClientXCtrl, "SetServerAddress", SetServerAddress, VT_EMPTY,
VTS_BSTR)

--------function body:
void CUClientXCtrl::SetServerAddress(LPCTSTR value)
{
//here comes an error message: reference not set to an instance of
object
if(value != "some value")
{
m_ServerAddress = value;
SetModifiedFlag();
BoundPropertyChanged(dispidCtiServerAddress);
}
}