1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

CMFCRibbonSlider - Cant use a inherited class?

Discussion in 'MFC' started by karljj1, Mar 10, 2010.

  1. karljj1

    karljj1 New Member

    Joined:
    Mar 10, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hello,

    I have created a inherited class from CMFCRibbonSlider. However when i click on the ribbon button to display the slider the application crashes.
    It seems to crash when it tries to get the runtime class.
    Can anyone tell me where i have gone wrong?

    Thanks
    -----------
    .h
    -----------
    Code:
    #pragma once
    
    
    // KMFCRibbonSlider
    
    class KMFCRibbonSlider : public CMFCRibbonSlider
    {
    	DECLARE_DYNAMIC( KMFCRibbonSlider )
    
    public:
    	
    	KMFCRibbonSlider();
    
    	KMFCRibbonSlider( UINT nID, int nWidth = 100 );
    
    	virtual ~KMFCRibbonSlider();
    
    protected:
    	
    };
    
    ---------
    .cpp
    ---------
    
    // GUI/Components/KMFCRibbonSlider.cpp : implementation file
    //
    
    #include "../../stdafx.h"
    #include "KMFCRibbonSlider.h"
    
    //////////////////////////////////////////////////////////////////////////
    
    IMPLEMENT_DYNAMIC( KMFCRibbonSlider, CMFCRibbonSlider )
    
    //////////////////////////////////////////////////////////////////////////
    
    KMFCRibbonSlider::KMFCRibbonSlider()
    {
    }
    
    //////////////////////////////////////////////////////////////////////////
    
    KMFCRibbonSlider::KMFCRibbonSlider( UINT nID, int nWidth /*= 100 */ ):
    CMFCRibbonSlider( nID, nWidth )
    {
    }
    
    //////////////////////////////////////////////////////////////////////////
    
    KMFCRibbonSlider::~KMFCRibbonSlider()
    {
    }
    
    //////////////////////////////////////////////////////////////////////////
     

Share This Page