Click here to Skip to main content
15,889,852 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: where is the mistake. Pin
Blake Miller20-Dec-05 4:37
Blake Miller20-Dec-05 4:37 
Questionstatic data member. Pin
paper6719-Dec-05 7:56
paper6719-Dec-05 7:56 
AnswerRe: static data member. Pin
PJ Arends19-Dec-05 11:38
professionalPJ Arends19-Dec-05 11:38 
GeneralRe: static data member. Pin
vikas amin19-Dec-05 19:02
vikas amin19-Dec-05 19:02 
GeneralRe: static data member. Pin
Eytukan19-Dec-05 21:27
Eytukan19-Dec-05 21:27 
QuestionGraphics in dialog window Pin
josephmanu19-Dec-05 7:20
josephmanu19-Dec-05 7:20 
AnswerRe: Graphics in dialog window Pin
Chris Losinger19-Dec-05 7:37
professionalChris Losinger19-Dec-05 7:37 
GeneralRe: Graphics in dialog window Pin
josephmanu19-Dec-05 11:24
josephmanu19-Dec-05 11:24 
Thanks. That works pretty good. But I must be doing something else wrong. Below is a snip from a simple dialog program to draw a box when a button is pushed. I put the drawing stuff in the OnPaint. Although it does redraw the box most of the time, when I drag another window over the box slowly, sometimes I get lines where the box was not totally redrawn.

void CBoxDlg::OnPaint()
{
int x, y;

CPaintDC dc(this); // device context for painting

if (IsIconic())
{
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);

// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;

// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
if (draw_rectangle == TRUE)
{
for(x=0;x<100;x++)
{
for(y=0;y<100;y++)
{
dc.SetPixel(x,y,RGB(240,0,0));
}
}
}
}
}

void CBoxDlg::OnDrawButton()
{
draw_rectangle = TRUE;
RedrawWindow();
}
Questioni need an example Pin
markshte19-Dec-05 5:33
markshte19-Dec-05 5:33 
QuestionTape Drive help required Pin
Touseef Afzal19-Dec-05 2:09
Touseef Afzal19-Dec-05 2:09 
AnswerRe: Tape Drive help required Pin
kakan19-Dec-05 2:40
professionalkakan19-Dec-05 2:40 
GeneralRe: Tape Drive help required Pin
Touseef Afzal19-Dec-05 3:29
Touseef Afzal19-Dec-05 3:29 
GeneralRe: Tape Drive help required Pin
kakan19-Dec-05 3:50
professionalkakan19-Dec-05 3:50 
GeneralRe: Tape Drive help required Pin
Touseef Afzal19-Dec-05 4:07
Touseef Afzal19-Dec-05 4:07 
GeneralRe: Tape Drive help required Pin
kakan19-Dec-05 18:35
professionalkakan19-Dec-05 18:35 
GeneralRe: Tape Drive help required Pin
Touseef Afzal19-Dec-05 19:16
Touseef Afzal19-Dec-05 19:16 
Questionopen jpeg file on listbox Pin
uumeme19-Dec-05 1:33
uumeme19-Dec-05 1:33 
AnswerRe: open jpeg file on listbox Pin
Maximilien19-Dec-05 2:50
Maximilien19-Dec-05 2:50 
AnswerRe: open jpeg file on listbox Pin
Pale_Master19-Dec-05 5:38
Pale_Master19-Dec-05 5:38 
QuestionApplication has encountered a problem... Pin
Eytukan19-Dec-05 1:26
Eytukan19-Dec-05 1:26 
AnswerRe: Application has encountered a problem... Pin
ThatsAlok19-Dec-05 2:01
ThatsAlok19-Dec-05 2:01 
GeneralRe: Application has encountered a problem... Pin
Eytukan19-Dec-05 2:24
Eytukan19-Dec-05 2:24 
QuestionWhy does malloc( ) fail in one .cpp file but not another? Pin
dabs19-Dec-05 0:47
dabs19-Dec-05 0:47 
AnswerRe: Why does malloc( ) fail in one .cpp file but not another? Pin
dabs19-Dec-05 1:20
dabs19-Dec-05 1:20 
QuestionPost Message From Dlg -&gt; Specific View Pin
sdancer7519-Dec-05 0:06
sdancer7519-Dec-05 0:06 

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.