#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    Karlsruhe, Germany
    Posts
    2
    Rep Power
    0

    slider on dialog


    Hi,

    I'm trying to add a custom dialog to my MFC based project which has a Slider control on it. I have a member variable for the dialog which lets me access controls on the dialog, but when I run the program and try to access the slider control I get a debug assertion failed error in file 'afxcmn.inl', although if i try to set these values in the 'OnInitDialog()' function in the class for the dialog for examplle it works fine.

    Any Ideas on why this is happening would be very appreciated

    Cheers

    Liam
  2. #2
  3. No Profile Picture
    Offensive Member
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2002
    Location
    in the perfect world
    Posts
    622
    Rep Power
    27
    Have you set the member variable to the control in the DoDataExchange() handler?


    Code:
    void  MyDialog:: DoDataExchange( CDataExchange* pDX)
    {
    	CDialog:: DoDataExchange(pDX);
            DDX_Control( pDX, IDC_SLIDER,  m_CSlider_ThisSlider );
    The essence of Christianity is told us in the Garden of Eden history. The fruit that was forbidden was on the Tree of Knowledge. The subtext is, All the suffering you have is because you wanted to find out what was going on. You could be in the Garden of Eden if you had just kept your f***ing mouth shut and hadn't asked any questions.

    Frank Zappa
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    Karlsruhe, Germany
    Posts
    2
    Rep Power
    0
    Yes, the code to set the member variable was added automatically to the DoDataExchange() handler by the class wizard when the variable was created
  6. #4
  7. No Profile Picture
    Offensive Member
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2002
    Location
    in the perfect world
    Posts
    622
    Rep Power
    27
    >>try to access the slider control I get a debug assertion<<

    When do you try to access the slider?
    How do you try to access it?
    Has been created at this point?

    Post some code or we have no chance to help.
    The essence of Christianity is told us in the Garden of Eden history. The fruit that was forbidden was on the Tree of Knowledge. The subtext is, All the suffering you have is because you wanted to find out what was going on. You could be in the Garden of Eden if you had just kept your f***ing mouth shut and hadn't asked any questions.

    Frank Zappa

IMN logo majestic logo threadwatch logo seochat tools logo