Click here to Skip to main content
13,804,094 members

C / C++ / MFC

 
AnswerRe: Found Api's Causing Heap Corruption Pin
CPallini5-Dec-18 4:08
mvpCPallini5-Dec-18 4:08 
GeneralRe: Found Api's Causing Heap Corruption Pin
ForNow5-Dec-18 4:11
memberForNow5-Dec-18 4:11 
GeneralRe: Found Api's Causing Heap Corruption CPallini You are Great thanks Pin
ForNow5-Dec-18 4:40
memberForNow5-Dec-18 4:40 
GeneralRe: Found Api's Causing Heap Corruption CPallini You are Great thanks Pin
CPallini5-Dec-18 7:50
mvpCPallini5-Dec-18 7:50 
GeneralRe: Found Api's Causing Heap Corruption CPallini You are Great thanks Pin
ForNow5-Dec-18 8:28
memberForNow5-Dec-18 8:28 
GeneralRe: Found Api's Causing Heap Corruption Pin
Richard MacCutchan5-Dec-18 8:43
protectorRichard MacCutchan5-Dec-18 8:43 
GeneralRe: Found Api's Causing Heap Corruption Pin
CPallini5-Dec-18 8:49
mvpCPallini5-Dec-18 8:49 
QuestionCComboBox list Appears After Trying to Close out Dialog Pin
ForNow4-Dec-18 17:06
memberForNow4-Dec-18 17:06 
Hi
I Decided to start a new thread because for a moment I thought I had fixed my problem of the Disappearing list with the following code

I added a point to an array pointer for the strings I wanted to add

class Casidcombo :	public CComboBox
{
	DECLARE_DYNAMIC(Casidcombo)
	private:
		int cright, cbottom, ctop;

public:
	Casidcombo();
	~Casidcombo();
	char **arrayptr;
protected:
	
	virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
	virtual void DrawItem(LPDRAWITEMSTRUCT pdi);
	virtual int CompareItem(LPCOMPAREITEMSTRUCT lpCompareItemStruct);
	virtual void DeleteItem(LPDELETEITEMSTRUCT lpDeleteItemStruct);
	DECLARE_MESSAGE_MAP()
};


its the arrayptr not knowing exactly how may entries I would have I initialize it in the
OnInitDialogBox of the the Hosting Dialog

m_Simple.arrayptr = new char *[j+1];
	for (int i = 0; i < j + 1; i++)
		m_Simple.arrayptr[i] = NULL;


In the DrawItem For The Combobox I copy of over part of the string

if(arrayptr[pdi->itemID] == NULL)
	        arrayptr[pdi->itemID] = new char(9);
	memset(arrayptr[pdi->itemID], 0x00, 9);
	memcpy(arrayptr[pdi->itemID], lpszText, 8);


I then write it out

dc.DrawText(
		arrayptr[pdi->itemID],
		8,
	    &pdi->rcItem,
		DT_CENTER | DT_SINGLELINE | DT_VCENTER);


The list now re-appears After I try closing out the Dialog by clicking on the 'X'
in the right hand Corner

I guess this drives the DrawItem function

My question is after appearing and disappearing initially (the list) of the ComboBox the vertical scroll bar is missing as well until I clisk on the 'X' in the right hand corner after which everything re-appears I guess that most Drive DrawItem I am still Baffled Why initially it disappears along with the scroll bar

This the last piece of code in the OnInitDialog

ShowWindow(SW_SHOW);
	ShowWindow(SW_SHOW);

		return TRUE;

This is my message map I only have a Measure Item Message
BEGIN_MESSAGE_MAP(Casidcombo, CComboBox)
		ON_WM_MEASUREITEM()
	    	END_MESSAGE_MAP()


modified 4-Dec-18 22:16pm.

GeneralRe: CComboBox list Appears After Trying to Close out Dialog Pin
Richard MacCutchan4-Dec-18 23:13
protectorRichard MacCutchan4-Dec-18 23:13 
GeneralRe: CComboBox list Appears After Trying to Close out Dialog Pin
ForNow5-Dec-18 3:09
memberForNow5-Dec-18 3:09 
GeneralRe: CComboBox list Appears After Trying to Close out Dialog Pin
Richard MacCutchan5-Dec-18 3:41
protectorRichard MacCutchan5-Dec-18 3:41 
GeneralRe: CComboBox list Appears After Trying to Close out Dialog Pin
ForNow5-Dec-18 3:50
memberForNow5-Dec-18 3:50 
GeneralRe: CComboBox list Appears After Trying to Close out Dialog Pin
Richard MacCutchan5-Dec-18 8:36
protectorRichard MacCutchan5-Dec-18 8:36 
NewsMessage Closed Pin
4-Dec-18 13:15
memberMember 140776634-Dec-18 13:15 
Question"undefined reference " error - what am I missing ? Pin
Vaclav_4-Dec-18 8:19
memberVaclav_4-Dec-18 8:19 
AnswerRe: "undefined reference " error - what am I missing ? Pin
leon de boer4-Dec-18 8:36
memberleon de boer4-Dec-18 8:36 
GeneralRe: "undefined reference " error - what am I missing ? Pin
Vaclav_4-Dec-18 8:50
memberVaclav_4-Dec-18 8:50 
QuestionRe: "undefined reference " error - what am I missing ? Pin
Richard MacCutchan4-Dec-18 9:55
protectorRichard MacCutchan4-Dec-18 9:55 
AnswerRe: "undefined reference " error - what am I missing ? Pin
Joe Woodbury4-Dec-18 10:02
professionalJoe Woodbury4-Dec-18 10:02 
GeneralRe: "undefined reference " error - what am I missing ? Pin
Vaclav_4-Dec-18 13:33
memberVaclav_4-Dec-18 13:33 
GeneralRe: "undefined reference " error - what am I missing ? Pin
Joe Woodbury4-Dec-18 13:36
professionalJoe Woodbury4-Dec-18 13:36 
GeneralRe: "undefined reference " error - what am I missing ? Pin
Vaclav_4-Dec-18 16:15
memberVaclav_4-Dec-18 16:15 
GeneralRe: "undefined reference " error - what am I missing ? Pin
Joe Woodbury4-Dec-18 19:48
professionalJoe Woodbury4-Dec-18 19:48 
GeneralRe: "undefined reference " error - what am I missing ? Pin
Vaclav_5-Dec-18 5:35
memberVaclav_5-Dec-18 5:35 
GeneralRe: "undefined reference " error - what am I missing ? Pin
Richard MacCutchan4-Dec-18 23:00
protectorRichard MacCutchan4-Dec-18 23:00 

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.


Advertise | Privacy | Cookies | Terms of Service
Web05 | 2.8.181218.1 | Last Updated 19 Dec 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid