Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » Link error while using a derived class from CExtGridCellComboBox Collapse All
Subject Author Date
Nitesh Singh Sep 7, 2006 - 3:50 AM

Sir,
I am trying to support a my customized combobox (for propertygrid) which draw a line of a certain thickness. To support that I am deriving a class CMyGridCellLWComboBox from CExtGridCellComboBox. I was overriding OnPopupListBoxItemDraw. and inside the body of the overriding function I have copied and pasted the same code (body of CExtGridCellComboBox::OnPopupListBoxItemDraw()) with some modification. For derived class I was following the same approach which was done for a customized GridCellNumber.
But the problem is that when I am populating my class it is giving some link errors. I have asked you the same by mail. and attached my sample project.. You can please check what informations are missing Please reply soon.
Thank you.

Nitesh Singh Sep 7, 2006 - 5:54 AM

Thank you.. that helped.. it is working atleast in the sample project now.. I will check it in the main project now.

I have one more question..... Which function is responsible for drawing the current string in the combobox... I am not talking about the popupListBox... I want to show a line with a thinkness and a string in the combobox.. and that should be displayed even if that perticular item is not selected. thanks

Suhai Gyorgy Sep 7, 2006 - 6:44 AM

Oh, I found this method in Help: CExtGridCell::OnPaintText
It has lots of parameters, but you can have the default method do the text-painting and use the appropiate CRect parameter for drawing that line you need. Maybe that’ll work.

Suhai Gyorgy Sep 7, 2006 - 6:20 AM

My first guess would be to try pMyGridCell->TextSet() method, but I think you already tried that. And if it doesn’t work.... you’ll have to wait for Support’s answer:)

Suhai Gyorgy Sep 7, 2006 - 5:14 AM

In sample SimpleGrid you can see some CExtGridCell*-derived classes. What they all have in common is that the following code goes with all of them:
in .h

	DECLARE_DYNCREATE( CDerivedCell );
	IMPLEMENT_ExtGridCell_Clone( CDerivedCell, CExtGridCellStringDM );
	CDerivedCell(
		CExtGridDataProvider * pDP = NULL
		);
in .cpp
CDerivedCell::CDerivedCell(
	CExtGridDataProvider * pDP // = NULL
	)
	: CExtGridCellStringDM( pDP )
{
}
And one more thing which is the major problem for you, I think, is on the very top of the .cpp:
#include "stdafx.h"
#include "SimpleGrids.h"
#include "ChildView.h"
#include ".\childview.h"

// moved to top (i.e. before DEBUG_NEW) to avoid
// conflict with MFC’s operator new
IMPLEMENT_DYNCREATE( CDerivedCell, CExtGridCellStringDM );

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif