Click here to Skip to main content
15,898,036 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I'm developing a ActiveX control that I want to able to change the colour various parts of it. I know I can use the stock property page of it. I don't wish use it, because I want greater flexabitly.
Declartion in the IDL file:
C++
[id(4) , helpstring("property myColour")] OLE_COLOR myColour;

I've made the implentaion as notification. Therefore, in the the control's cpp file
C++
DISP_PROPERTY_NOTIFY_ID(CMyActiveXCtrl, "myColour", dispidmyColour, m_myColour, OnmyColourChanged, VT_COLOR)

The property page in question I have a Static control which I intend to map to the property. Which is declared as such:
C++
private:
    CColourStatic m_selectedColour;  // Subclassed from CStatic
    COLORREF m_nColourVal;


Now the problem is when I call UpdateData the data exchange doesn't work when I uncomment the DDP_Text line. When it commented it works for the static control only.
C++
void CColoursPropPage::DoDataExchange(CDataExchange* pDX)
{
//  DDP_Text(pDX, IDC_BKCOLOUR_STATIC, (OLE_COLOR)m_nColourVal, _T("myColour"));
    DDX_Text(pDX, IDC_BKCOLOUR_STATIC, m_nColourVal);
    DDX_Control(pDX, IDC_BKCOLOUR_STATIC, m_selectedColour);
    DDP_PostProcessing(pDX);
}

Can anyone tell we how to solve without adding the stock prop page.

Thanks in advance.

Alton.
Posted

1 solution

The property getter and setter has to be done by hand the code for it is here [^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900