Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Adding a property to a Activex in VS2005 - VC++

freshlimefreshlime Member Posts: 2
Hi,

I am working on a ActiveX in VS2005 (VC++).

I have been getting problem in adding a custom property to the property page.

Since we do not have class vizard in VS2005 for VC++ , I have manually coded the property at required places.

This is what I did:
1.Added a checkbox to the dialog page:IDC_COMPASSVISIBILITY

2. Added the code for DoDataExchange in property page:
DDP_Check(pDX, IDC_COMPASSVISIBILITY, m_compassVisibility, _T("compassVisibility") );
DDX_Check(pDX, IDC_COMPASSVISIBILITY, m_compassVisibility);

3.Added the following in the DoPropExchange of Ctrl Page
PX_Bool(pPX, _T("compassVisibility"), m_compassVisibility, FALSE);

4.Provided the following in the dispatch map
DISP_PROPERTY_NOTIFY(CActiveTextCtrl, "compassVisibility", m_compassVisibility, OnCompassVisibilityChanged, VT_BOOL)

5.Provided the implementation for onCompassVisbilityChanged in the Ctrl Page

But this does not seem to work. When I modify the checkbox value, the method onCompassVisibilty changed is not getting called.

Am I misssing something? Please help.

Thanks a lot for your time.

Comments

  • freshlimefreshlime Member Posts: 2
    Hi,

    It will be of good help, if you can tell me how to add a custom property in a MFC ActiveX in VS2005 (VC++).


    This what i am trying to do to my activex:
    1.Add a checkbox in the property
    2.Do something to my control whenever the checkbox is checked/uncheckd

    I have searched a lot in the web , but haven't found any suitable material for this.

    Thank you.






    : Hi,
    :
    : I am working on a ActiveX in VS2005 (VC++).
    :
    : I have been getting problem in adding a custom property to the
    : property page.
    :
    : Since we do not have class vizard in VS2005 for VC++ , I have
    : manually coded the property at required places.
    :
    : This is what I did:
    : 1.Added a checkbox to the dialog page:IDC_COMPASSVISIBILITY
    :
    : 2. Added the code for DoDataExchange in property page:
    : DDP_Check(pDX, IDC_COMPASSVISIBILITY, m_compassVisibility,
    : _T("compassVisibility") );
    : DDX_Check(pDX, IDC_COMPASSVISIBILITY, m_compassVisibility);
    :
    : 3.Added the following in the DoPropExchange of Ctrl Page
    : PX_Bool(pPX, _T("compassVisibility"), m_compassVisibility, FALSE);
    :
    : 4.Provided the following in the dispatch map
    : DISP_PROPERTY_NOTIFY(CActiveTextCtrl, "compassVisibility",
    : m_compassVisibility, OnCompassVisibilityChanged, VT_BOOL)
    :
    : 5.Provided the implementation for onCompassVisbilityChanged in the
    : Ctrl Page
    :
    : But this does not seem to work. When I modify the checkbox value,
    : the method onCompassVisibilty changed is not getting called.
    :
    : Am I misssing something? Please help.
    :
    : Thanks a lot for your time.
Sign In or Register to comment.