C / C++ / MFC
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
int cright, cbottom, ctop;
virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
virtual void DrawItem(LPDRAWITEMSTRUCT pdi);
virtual int CompareItem(LPCOMPAREITEMSTRUCT lpCompareItemStruct);
virtual void DeleteItem(LPDELETEITEMSTRUCT lpDeleteItemStruct);
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
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
This is my message map I only have a Measure Item Message
modified 4-Dec-18 22:16pm.
General News Suggestion Question Bug Answer Joke Praise Rant Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.
Copyright © CodeProject
All Rights Reserved.