Click here to Skip to main content
14,209,092 members
Rate this:
Please Sign up or sign in to vote.
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:
[id(4) , helpstring("property myColour")] OLE_COLOR myColour;

I've made the implentaion as notification. Therefore, in the the control's cpp file
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:
    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.
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);

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

Thanks in advance.


1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

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

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

Advertise | Privacy | Cookies | Terms of Service
Web03 | 2.8.190617.3 | Last Updated 11 Jan 2012
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100