Click here to Skip to main content
15,921,793 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: what is the result(union & structure)? Pin
CPallini15-Dec-11 10:10
mveCPallini15-Dec-11 10:10 
QuestionHow to Convert vector::reference to vector::iterator ? Pin
002comp13-Dec-11 20:21
002comp13-Dec-11 20:21 
AnswerRe: How to Convert vector::reference to vector::iterator ? Pin
Chris Losinger14-Dec-11 2:22
professionalChris Losinger14-Dec-11 2:22 
AnswerRe: How to Convert vector::reference to vector::iterator ? Pin
Stefan_Lang14-Dec-11 5:40
Stefan_Lang14-Dec-11 5:40 
GeneralRe: How to Convert vector::reference to vector::iterator ? Pin
002comp14-Dec-11 17:30
002comp14-Dec-11 17:30 
Questionhow to test a compressed file in MFC? Pin
Le@rner13-Dec-11 20:20
Le@rner13-Dec-11 20:20 
AnswerRe: how to test a compressed file in MFC? Pin
Richard MacCutchan13-Dec-11 22:09
mveRichard MacCutchan13-Dec-11 22:09 
GeneralRe: how to test a compressed file in MFC? Pin
Le@rner13-Dec-11 23:52
Le@rner13-Dec-11 23:52 
GeneralRe: how to test a compressed file in MFC? Pin
Richard MacCutchan14-Dec-11 0:08
mveRichard MacCutchan14-Dec-11 0:08 
GeneralRe: how to test a compressed file in MFC? Pin
Le@rner14-Dec-11 0:35
Le@rner14-Dec-11 0:35 
GeneralRe: how to test a compressed file in MFC? Pin
Richard MacCutchan14-Dec-11 0:38
mveRichard MacCutchan14-Dec-11 0:38 
GeneralRe: how to test a compressed file in MFC? Pin
Le@rner14-Dec-11 0:46
Le@rner14-Dec-11 0:46 
QuestionRe: how to test a compressed file in MFC? Pin
David Crow14-Dec-11 3:34
David Crow14-Dec-11 3:34 
AnswerRe: how to test a compressed file in MFC? Pin
Le@rner14-Dec-11 17:16
Le@rner14-Dec-11 17:16 
QuestionRe: how to test a compressed file in MFC? Pin
David Crow15-Dec-11 2:07
David Crow15-Dec-11 2:07 
QuestionMessure function execution time Pin
columbos1492713-Dec-11 1:40
columbos1492713-Dec-11 1:40 
AnswerRe: Messure function execution time Pin
enhzflep13-Dec-11 1:48
enhzflep13-Dec-11 1:48 
GeneralRe: Messure function execution time Pin
columbos1492713-Dec-11 2:09
columbos1492713-Dec-11 2:09 
AnswerRe: Messure function execution time Pin
Stefan_Lang13-Dec-11 2:29
Stefan_Lang13-Dec-11 2:29 
JokeRe: Messure function execution time Pin
Code-o-mat13-Dec-11 5:12
Code-o-mat13-Dec-11 5:12 
QuestionProblem with owner drawn listbox and double buffering Pin
aangerma13-Dec-11 1:26
aangerma13-Dec-11 1:26 
Hello,

I created owner drawn listbox and I used double buffering
for preventing flickering because I have a lot of data ,
the problem is that its don't present all the items and ,
whan I scroll it down and up its erases part of the items,
the code is:

C++
void HistDlg::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)
{
	if(IDC_LIST1 ==nIDCtl)
	{
		int width=lpDrawItemStruct->rcItem.right-lpDrawItemStruct->rcItem.left;
		int height=lpDrawItemStruct->rcItem.bottom-lpDrawItemStruct->rcItem.top;
		HDC memDC1 = CreateCompatibleDC(lpDrawItemStruct->hDC);
		HBITMAP hMemBmp = CreateCompatibleBitmap(lpDrawItemStruct->hDC,width , height);
		HBITMAP hOldBmp = (HBITMAP)SelectObject(memDC1, hMemBmp);
		CDC *memDC=CDC::FromHandle(memDC1);
		memDC->FillSolidRect(0,0, width, height,RGB(255,255,255));

		int	 ODI_length =  
		1 + SendDlgItemMessage(IDC_LIST1,
								   LB_GETTEXTLEN,
								   lpDrawItemStruct->itemID,
								   0);

		if (ODI_length)
		{
			wchar_t *ODI_wstr = NULL;
			ODI_wstr = new wchar_t[ODI_length];
			if (ODI_wstr)
			{
				COLORREF ODI_old_text_color;
				//get the string
				SendDlgItemMessage(IDC_LIST1,
								   LB_GETTEXT,
								   lpDrawItemStruct->itemID,
								   (LPARAM)ODI_wstr);
					
					
				memDC->DrawText(ODI_wstr,
							  ODI_length - 1,
							  &lpDrawItemStruct->rcItem,
							  DT_RIGHT);
				
			}

		}
	
		BitBlt(lpDrawItemStruct->hDC, 0, 0, width,height, memDC1, 0, 0, SRCCOPY);
		SelectObject(memDC1, hOldBmp);
		DeleteObject(hMemBmp);
		DeleteDC(memDC1);
	}
}


What doe's I'm doing wrong?

thanks
QuestionRe: Problem with owner drawn listbox and double buffering Pin
CPallini13-Dec-11 1:49
mveCPallini13-Dec-11 1:49 
QuestionThread Sync Pin
columbos1492712-Dec-11 22:22
columbos1492712-Dec-11 22:22 
AnswerRe: Thread Sync Pin
Richard MacCutchan12-Dec-11 22:55
mveRichard MacCutchan12-Dec-11 22:55 
AnswerRe: Thread Sync Pin
Albert Holguin13-Dec-11 3:19
professionalAlbert Holguin13-Dec-11 3:19 

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.