rahul.agrawal 0 Newbie Poster

Hi All..

I want to generate a dialog bar or panel inside a window, for that i have seen a sample code somewhere (implemented on VC++ 6.0)..
Now i am trying to use that code in visual studio 2008 but an assertion failed error is being occured..while i am using same code..

The code snippet from sample code is :

// Set the collapsible control bar.
	m_wndCollapsiblePanel.CreateTheContainer(this,   
                                                                               IDD_PANEL, true);

Declaration and Definitions :

BOOL CCollapsiblePanel::CreateTheContainer(CFrameWnd* pTheDialog, UINT nID, bool Dockable)
{
	// Create the default dialog bar.
	BOOL bRes = m_wndDialogBar.Create(pTheDialog, nID, WS_VISIBLE|WS_CHILD|CBRS_LEFT|CBRS_SIZE_DYNAMIC, 2);
	
    if ( Dockable == true )
    {
        m_wndDialogBar.EnableDocking(CBRS_ALIGN_RIGHT|CBRS_ALIGN_LEFT);
	    pTheDialog->DockControlBar(&m_wndDialogBar);
        m_wndDialogBar.isDockable = true;
    }

	return bRes;
}




// CCollapsiblePanel class declaration.

class CCollapsiblePanel  
{
public:

	// Create the base control bar.
	BOOL CreateTheContainer(CFrameWnd* pTheDialog, UINT nID, bool Dockable = false);

	// Set the colors and the expand button bitmap.
	SetTheBkColor         (COLORREF newColor);
	SetExpandBitmap       (UINT BMP_EXPAND);
	SetMaskColor          (COLORREF newColor);
	SetButtonBkColor      (COLORREF newColor);
	SetButtonTextColor    (COLORREF newColor);
	SetDefaultSystemColor ();

	// Set the status bar and toolbar handles.
	SetTheControlBar (CToolBar* mainToolBar, CStatusBar* mainStatusBar);

	// Append a new button.
	int AppendButton (const char* Name, UINT BMP_LEFT, CDialog* thePanelViewClass, UINT ID_DIALOG_TO_ASSOCIATE);

private:
	CResizableDlgBar m_wndDialogBar;
	
	CWnd* GetTheControlWnd();
};

When i debug the code, there is a problem with the 2nd argument of the function BOOL CreateTheContainer(CFrameWnd* pTheDialog, UINT nID, bool Dockable = false);, which is shown in the given code :

// CDialogBar
_AFXEXT_INLINE BOOL CDialogBar::Create(CWnd* pParentWnd, UINT nIDTemplate,
		UINT nStyle, UINT nID)
	{ return Create(pParentWnd, MAKEINTRESOURCE(nIDTemplate), nStyle, nID); }

in the file afxext.inl
The above return displayes it is a bad ptr....while i am using as it is in the VC++ 6.0 version..


kindly suggest me wat should i do?

Thanx in advance..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.