Print Page | Close Window

XTexcelflatcontrol issue

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=5553
Printed Date: 14 May 2024 at 5:29am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: XTexcelflatcontrol issue
Posted By: babumohan
Subject: XTexcelflatcontrol issue
Date Posted: 18 November 2006 at 11:35am
I am using a CXTFlatTabCtrl to create a flat tab control
I have a class called
class CUserDockWnd :CUEXTPDockWindow

{

  CXTFlatTabCtrl m_objUserFlatCtrl;
  CUserFlexGrid m_objFlexGrid;
 
}
I have another class which is inherited from  CVsflexgridl1 (VS FlexGrid 8.0)

class CUserFlexGrid : public CVsflexgridl1
{

}


CUserDockWnd ::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    if (CUEXTPDockWindow::OnCreate(lpCreateStruct) == INVALID_VALUE) {
        UESRCLINKTRACE(_T("CUserDockWnd ::OnCreate() Failed\n"));
        return -1;
    }     
    m_objUserFlatCtrl.Create(WS_CHILD | WS_VISIBLE | FTS_XT_HSCROLL | FTS_XT_HASARROWS | FTS_XT_BOTTOM,CRect(0,0,0,0), this, IDC_FLATTAB))
    m_objFlexGrid.Create(NULL,WS_CHILD, Rect, &m_objUserFlatCtrl, IDC_UE_GRID_MSGAREA, NULL, NULL, NULL)
SetChild(&m_objUserFlatCtrlb);

}


On Debug mode I am getting Assertion window like below



Assertion Is coming on the following funtion


int CXTExcelTabCtrl::InsertItem(int nItem, LPCTSTR lpszItem, CWnd* pWndControl)
{
    const int cItems = GetItemCount();
    if (nItem < 0 || nItem > cItems)
        return -1;

    if (pWndControl)
    {
        ASSERT(::IsWindow(pWndControl->m_hWnd));

        // managed view should be a hidden child
        ASSERT((pWndControl->GetStyle() & (WS_VISIBLE | WS_CHILD)) == WS_CHILD);

....
}

-------------
Babs



Replies:
Posted By: Oleg
Date Posted: 19 November 2006 at 3:18am
Hello,
 
You don't show code where you call InsertItem.... anyway before call InsertItem check that m_objFlexGrid don't have WS_VISIBLE style.
 


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: babumohan
Date Posted: 22 November 2006 at 8:44pm
IsertItem Code :
CUserDockWnd ::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    if (CUEXTPDockWindow::OnCreate(lpCreateStruct) == INVALID_VALUE) {
        UESRCLINKTRACE(_T("CUserDockWnd ::OnCreate() Failed\n"));
        return -1;
    }     
    m_objUserFlatCtrl.Create(WS_CHILD | WS_VISIBLE | FTS_XT_HSCROLL | FTS_XT_HASARROWS | FTS_XT_BOTTOM,CRect(0,0,0,0), this, IDC_FLATTAB))
    m_objFlexGrid.Create(NULL,WS_CHILD, Rect, &m_objUserFlatCtrl, IDC_UE_GRID_MSGAREA, NULL, NULL, NULL)
SetChild(&m_objUserFlatCtrlb);
if (! m_objUserFlatCtrl.InsertItem(ZERO, "FlexGrid", &m_objFlexGrid)) {
            ASSERT(0);
        }


}



-------------
Babs


Posted By: Oleg
Date Posted: 23 November 2006 at 12:17am
May be FlexGrid automatically show self in Create. Hide it before InsertImte:
 
m_objFlexGrid.ModifyStyle(WS_VISIBLE, 0);


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: babumohan
Date Posted: 23 November 2006 at 1:23am
Still I am getting the same assertion Dialog box..
Below is the CVsflexgridl1 class declaration...

class CVsflexgridl1: public CWnd
{
protected:
    DECLARE_DYNCREATE(CVsflexgridl1)
public:
    CLSID const& GetClsid()
    {
        static CLSID const clsid
            = { 0xF026C11, 0x5A66, 0x4C2B, { 0x87, 0xB5, 0x88, 0xDD, 0xEB, 0xAE, 0x72, 0xA1 } };
        return clsid;
    }
        BOOL Create(LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd,
                UINT nID, CFile* pPersist = NULL, BOOL bStorage = FALSE,
                BSTR bstrLicKey = NULL)
    {
        return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID,
        pPersist, bStorage, bstrLicKey);
    }
}

-------------
Babs


Posted By: Oleg
Date Posted: 23 November 2006 at 5:47am
Hello,
Right, just tried in our sample and see same problem.
 
Reason that for Control windows GetStyle retirves control style not window style and control style have not  WS_CHILD style.
 
 
As solution I can only suggest comment this ASSERT message in sources and rebuild library in IDE/Wizard.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Oleg
Date Posted: 23 November 2006 at 5:49am
ps: for next release we will change it also to avoid same ASSERT...

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: babumohan
Date Posted: 23 November 2006 at 12:46pm
That Also I tried.. Still I am in the same track..

-------------
Babs


Posted By: Oleg
Date Posted: 24 November 2006 at 4:03am
Hello,
 
You tried comment ASSERT and still see it ? It can be only if you don't rebuild toolkit dll or use old version (may be you copied it to some place and use)


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: babumohan
Date Posted: 24 November 2006 at 1:46pm
Now It is ok..
 No Need to Remove the Assert Statement from the xtreme toolkit.
I override the insertitem method ans commented the assert statement.
 Now it is working fine..
Thank you



-------------
Babs



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net