Click here to Skip to main content
15,888,984 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Found Api's Causing Heap Corruption Pin
CPallini5-Dec-18 3:08
mveCPallini5-Dec-18 3:08 
GeneralRe: Found Api's Causing Heap Corruption Pin
ForNow5-Dec-18 3:11
ForNow5-Dec-18 3:11 
GeneralRe: Found Api's Causing Heap Corruption CPallini You are Great thanks Pin
ForNow5-Dec-18 3:40
ForNow5-Dec-18 3:40 
GeneralRe: Found Api's Causing Heap Corruption CPallini You are Great thanks Pin
CPallini5-Dec-18 6:50
mveCPallini5-Dec-18 6:50 
GeneralRe: Found Api's Causing Heap Corruption CPallini You are Great thanks Pin
ForNow5-Dec-18 7:28
ForNow5-Dec-18 7:28 
GeneralRe: Found Api's Causing Heap Corruption Pin
Richard MacCutchan5-Dec-18 7:43
mveRichard MacCutchan5-Dec-18 7:43 
GeneralRe: Found Api's Causing Heap Corruption Pin
CPallini5-Dec-18 7:49
mveCPallini5-Dec-18 7:49 
QuestionCComboBox list Appears After Trying to Close out Dialog Pin
ForNow4-Dec-18 16:06
ForNow4-Dec-18 16: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

C++
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

C++
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

C++
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

C++
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

C++
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 22:13
mveRichard MacCutchan4-Dec-18 22:13 
GeneralRe: CComboBox list Appears After Trying to Close out Dialog Pin
ForNow5-Dec-18 2:09
ForNow5-Dec-18 2:09 
GeneralRe: CComboBox list Appears After Trying to Close out Dialog Pin
Richard MacCutchan5-Dec-18 2:41
mveRichard MacCutchan5-Dec-18 2:41 
GeneralRe: CComboBox list Appears After Trying to Close out Dialog Pin
ForNow5-Dec-18 2:50
ForNow5-Dec-18 2:50 
GeneralRe: CComboBox list Appears After Trying to Close out Dialog Pin
Richard MacCutchan5-Dec-18 7:36
mveRichard MacCutchan5-Dec-18 7:36 
Question"undefined reference " error - what am I missing ? Pin
Vaclav_4-Dec-18 7:19
Vaclav_4-Dec-18 7:19 
AnswerRe: "undefined reference " error - what am I missing ? Pin
leon de boer4-Dec-18 7:36
leon de boer4-Dec-18 7:36 
GeneralRe: "undefined reference " error - what am I missing ? Pin
Vaclav_4-Dec-18 7:50
Vaclav_4-Dec-18 7:50 
QuestionRe: "undefined reference " error - what am I missing ? Pin
Richard MacCutchan4-Dec-18 8:55
mveRichard MacCutchan4-Dec-18 8:55 
AnswerRe: "undefined reference " error - what am I missing ? Pin
Joe Woodbury4-Dec-18 9:02
professionalJoe Woodbury4-Dec-18 9:02 
GeneralRe: "undefined reference " error - what am I missing ? Pin
Vaclav_4-Dec-18 12:33
Vaclav_4-Dec-18 12:33 
GeneralRe: "undefined reference " error - what am I missing ? Pin
Joe Woodbury4-Dec-18 12:36
professionalJoe Woodbury4-Dec-18 12:36 
GeneralRe: "undefined reference " error - what am I missing ? Pin
Vaclav_4-Dec-18 15:15
Vaclav_4-Dec-18 15:15 
GeneralRe: "undefined reference " error - what am I missing ? Pin
Joe Woodbury4-Dec-18 18:48
professionalJoe Woodbury4-Dec-18 18:48 
GeneralRe: "undefined reference " error - what am I missing ? Pin
Vaclav_5-Dec-18 4:35
Vaclav_5-Dec-18 4:35 
GeneralRe: "undefined reference " error - what am I missing ? Pin
Richard MacCutchan4-Dec-18 22:00
mveRichard MacCutchan4-Dec-18 22:00 
QuestionString Search In C++ Pin
Hack Baba4-Dec-18 6:07
Hack Baba4-Dec-18 6:07 

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.