Click here to Skip to main content
15,885,782 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: saving list control data in a string Pin
Sarath C18-Feb-09 0:28
Sarath C18-Feb-09 0:28 
QuestionSuppressing dialog UI in a property sheet Pin
Mushtaque Nizamani17-Feb-09 23:28
Mushtaque Nizamani17-Feb-09 23:28 
AnswerRe: Suppressing dialog UI in a property sheet Pin
«_Superman_»17-Feb-09 23:42
professional«_Superman_»17-Feb-09 23:42 
GeneralRe: Suppressing dialog UI in a property sheet Pin
Mushtaque Nizamani18-Feb-09 0:02
Mushtaque Nizamani18-Feb-09 0:02 
AnswerRe: Suppressing dialog UI in a property sheet Pin
_AnsHUMAN_ 18-Feb-09 0:14
_AnsHUMAN_ 18-Feb-09 0:14 
QuestionProblem passing an array of UDT from Excel VBA to a C++ dll Pin
eight17-Feb-09 23:28
eight17-Feb-09 23:28 
AnswerRe: Problem passing an array of UDT from Excel VBA to a C++ dll Pin
dishaagrawal8-Dec-09 5:49
dishaagrawal8-Dec-09 5:49 
QuestionUnable to print Images in ListBox Pin
hemlat17-Feb-09 22:21
hemlat17-Feb-09 22:21 
Hi,
I using MFC in my Application.My Application single document Application. I have selected Document/view architecture support and Unicode Libraries.

I want to Print Images in ListBox. I have created one Dialog which is having ListBox and added class to it. I have written one Abstract class. In that I have decleared Pure virutul functions.

class CDrawC
{
protected:
	virtual void DrawItem(LPDRAWITEMSTRUCT lpdis, bool bHasFocus) = 0;
	virtual void MeasureItem(LPMEASUREITEMSTRUCT lpmis) = 0;
	virtual void InitLBox(CListBox* pLBox) = 0;
	virtual int AddItemLst(CListBox* pLBox, char* Item) = 0;
	friend class CODrawLBox;
};


I have derived class from above class and overriden the functions DrawItem(),MeasureItem() and AddItemLst().

class CPicDrawC : public CDrawC
{
public: 
	CPicDrawC() : PicSizeX(200), PicSizeY(200) {}
	const int PicSizeX;
	const int PicSizeY;
protected:
	virtual void DrawItem(LPDRAWITEMSTRUCT lpdis, bool bHasFocus);
	virtual void MeasureItem(LPMEASUREITEMSTRUCT lpmis);
	virtual void InitLBox(CListBox* pLBox) {} //no init needed
	virtual int AddItemLst(CListBox* pLBox, char* nItem);
	
};


I have created ListBox variable and changed its type to CODrawLBox Class type which is derived from CListBox.


class CODrawLBox : public CListBox
{
	DECLARE_DYNAMIC(CODrawLBox)

public:
	CODrawLBox();
virtual ~CODrawLBox();
void SetDrawC(CDrawC* pDrwC) {
        m_pDrawC = pDrwC;
	}

void Init() {
		m_pDrawC->InitLBox(this);
	}

	
int AddItem(char* Item) 
	{
        return m_pDrawC->AddItemLst(this, Item);
	}

protected:
	DECLARE_MESSAGE_MAP()
public:
	virtual void MeasureItem(LPMEASUREITEMSTRUCT /*lpMeasureItemStruct*/);
	virtual void DrawItem(LPDRAWITEMSTRUCT /*lpDrawItemStruct*/);
protected:
	CDrawC* m_pDrawC;
};


In the OninitDialog of Dialog I am using following code to display images.
char* path = new char[128];
strcpy(path,"C:\\ProgramFiles\\MTAF\\Reports\\Tc_1_11032008_083859123_2.bmp");
m_picList.AddItem(path);




Images are not displaying in ListBox.I am sure I am missing something.what will be the reason.

Regards,
Rekha.
AnswerRe: Unable to print Images in ListBox Pin
Iain Clarke, Warrior Programmer17-Feb-09 22:58
Iain Clarke, Warrior Programmer17-Feb-09 22:58 
GeneralRe: Unable to print Images in ListBox Pin
hemlat17-Feb-09 23:16
hemlat17-Feb-09 23:16 
GeneralRe: Unable to print Images in ListBox Pin
Iain Clarke, Warrior Programmer17-Feb-09 23:20
Iain Clarke, Warrior Programmer17-Feb-09 23:20 
QuestionHow to get the password in IAS extension dll if ms-chap is used by radius client? Pin
okmnji7951317-Feb-09 21:55
okmnji7951317-Feb-09 21:55 
QuestionHow do I get the error message displayed on a console ? Pin
SherTeks17-Feb-09 21:12
SherTeks17-Feb-09 21:12 
AnswerRe: How do I get the error message displayed on a console ? Pin
Stuart Dootson17-Feb-09 22:26
professionalStuart Dootson17-Feb-09 22:26 
AnswerRe: How do I get the error message displayed on a console ? Pin
Naveen17-Feb-09 22:28
Naveen17-Feb-09 22:28 
Questiontoken for the network saved network username? Pin
Green Fuze17-Feb-09 21:06
Green Fuze17-Feb-09 21:06 
Questionhow can i see data added to comboBox Pin
MahaKh17-Feb-09 20:59
MahaKh17-Feb-09 20:59 
AnswerRe: how can i see data added to comboBox Pin
Cedric Moonen17-Feb-09 21:21
Cedric Moonen17-Feb-09 21:21 
AnswerRe: how can i see data added to comboBox Pin
Chandrasekharan P17-Feb-09 21:36
Chandrasekharan P17-Feb-09 21:36 
GeneralRe: how can i see data added to comboBox Pin
MahaKh17-Feb-09 21:53
MahaKh17-Feb-09 21:53 
GeneralRe: how can i see data added to comboBox Pin
Chandrasekharan P17-Feb-09 23:06
Chandrasekharan P17-Feb-09 23:06 
AnswerRe: how can i see data added to comboBox Pin
Iain Clarke, Warrior Programmer18-Feb-09 0:19
Iain Clarke, Warrior Programmer18-Feb-09 0:19 
GeneralRe: how can i see data added to comboBox Pin
Chandrasekharan P18-Feb-09 0:30
Chandrasekharan P18-Feb-09 0:30 
Questiontypecasting WCHAR to char Pin
V K 217-Feb-09 20:31
V K 217-Feb-09 20:31 
AnswerRe: typecasting WCHAR to char Pin
Taran917-Feb-09 20:46
Taran917-Feb-09 20:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.