Click here to Skip to main content
16,005,734 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Populate a random __int64 Pin
PJ Arends29-Nov-05 9:32
professionalPJ Arends29-Nov-05 9:32 
Questionchanging default #defines in stdafx.h Pin
BlackDice29-Nov-05 4:44
BlackDice29-Nov-05 4:44 
AnswerRe: changing default #defines in stdafx.h Pin
Curtis Schlak.29-Nov-05 13:51
Curtis Schlak.29-Nov-05 13:51 
QuestionCDateTimeCtrl Questions Pin
#realJSOP29-Nov-05 4:15
professional#realJSOP29-Nov-05 4:15 
AnswerRe: CDateTimeCtrl Questions Pin
PJ Arends29-Nov-05 6:05
professionalPJ Arends29-Nov-05 6:05 
QuestionGDI+ cpu usage Pin
Alberto_Canabal29-Nov-05 3:48
Alberto_Canabal29-Nov-05 3:48 
AnswerRe: GDI+ cpu usage Pin
Shog929-Nov-05 11:39
sitebuilderShog929-Nov-05 11:39 
GeneralRe: GDI+ cpu usage Pin
Alberto_Canabal1-Dec-05 1:01
Alberto_Canabal1-Dec-05 1:01 
To start monitoring things, i wrote a simple GDI+ app., which draws a static rectangle and marks a variable area with a grid. The app. doesn't use double buffering (for the sake of simplicity)...

Here is my whole OnPaint method:

<br />
  //Get the invalid rectangle...<br />
  CRect rect;<br />
  GetUpdateRect(&rect);<br />
<br />
  CPaintDC dc(this);<br />
  Graphics graphics(dc.m_hDC);<br />
<br />
  //Clear the background...<br />
  graphics.Clear(Color::Black);<br />
<br />
  Color colorCross = Color::Red;<br />
  HatchBrush oBrushCross(HatchStyleCross, colorCross, <br />
           Color(0,0,0,0));<br />
<br />
  Pen oPenCross(colorCross, 0.0);<br />
	<br />
  RectF oRect(<br />
        rect.TopLeft().x + 50, <br />
	rect.TopLeft().y + 50, <br />
	rect.Width() - 50, <br />
	rect.Height() - 50);<br />
<br />
  //Paint the area with a grid...<br />
  graphics.FillRectangle(&oBrushCross, oRect);<br />
  graphics.DrawRectangle(&oPenCross, oRect);<br />
<br />
  Color color    = Color::Yellow;<br />
  HatchBrush oBrush(HatchStyleBackwardDiagonal, color, <br />
        Color(0,0,0,0));<br />
  Pen oPen(color, 0.0);<br />
<br />
  //Draw a static rectangle<br />
  RectF ooRect(100, 100, 200, 200);<br />
  graphics.FillRectangle(&oBrush, ooRect);<br />
  graphics.DrawRectangle(&oPen, ooRect);<br />


Results:
- CPU usage reaches nearly 70% (i'm working on a pretty good computer)
- Drawing is horrible...for example, when you hover another window over the dialog, it leaves "garbage", or doesn't repaint the variable area ok...

Any lights?????
Thanks!
GeneralRe: GDI+ cpu usage Pin
Shog91-Dec-05 10:56
sitebuilderShog91-Dec-05 10:56 
GeneralRe: GDI+ cpu usage Pin
Alberto_Canabal2-Dec-05 7:29
Alberto_Canabal2-Dec-05 7:29 
GeneralRe: GDI+ cpu usage Pin
Shog92-Dec-05 7:51
sitebuilderShog92-Dec-05 7:51 
Questionto send data from parent window to child window Pin
sheshidar29-Nov-05 3:28
sheshidar29-Nov-05 3:28 
AnswerRe: to send data from parent window to child window Pin
Cedric Moonen29-Nov-05 3:47
Cedric Moonen29-Nov-05 3:47 
GeneralRe: to send data from parent window to child window Pin
sheshidar30-Nov-05 0:54
sheshidar30-Nov-05 0:54 
QuestionChange Thread Name in MFC Pin
Pixinger7729-Nov-05 3:09
Pixinger7729-Nov-05 3:09 
AnswerRe: Change Thread Name in MFC Pin
Blake Miller29-Nov-05 5:13
Blake Miller29-Nov-05 5:13 
GeneralRe: Change Thread Name in MFC Pin
Blake Miller29-Nov-05 6:32
Blake Miller29-Nov-05 6:32 
GeneralRe: Change Thread Name in MFC Pin
Pixinger7722-Dec-05 23:21
Pixinger7722-Dec-05 23:21 
QuestionHow I can read the value of CPU's program counter . Pin
Loc Milkyway29-Nov-05 3:07
Loc Milkyway29-Nov-05 3:07 
Questionpop-up menu problem, inside splitter, using doc/view Pin
l00p1n629-Nov-05 3:00
l00p1n629-Nov-05 3:00 
Questionproblem with DirectSound application Pin
8ki29-Nov-05 3:00
8ki29-Nov-05 3:00 
QuestionHow to use Enum::Parse properly Pin
DWOO29-Nov-05 2:54
DWOO29-Nov-05 2:54 
QuestionFilters (highpass, lowpass, bandpass) Pin
Obliterator29-Nov-05 2:49
Obliterator29-Nov-05 2:49 
AnswerRe: Filters (highpass, lowpass, bandpass) Pin
Russell'29-Nov-05 3:54
Russell'29-Nov-05 3:54 
AnswerRe: Filters (highpass, lowpass, bandpass) Pin
Chris Losinger29-Nov-05 5:01
professionalChris Losinger29-Nov-05 5:01 

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.