Click here to Skip to main content
15,920,629 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralDialog boxes and views Pin
Sitaram Sukumar11-Dec-03 21:40
Sitaram Sukumar11-Dec-03 21:40 
GeneralRe: Dialog boxes and views Pin
Lido Paul11-Dec-03 21:52
Lido Paul11-Dec-03 21:52 
GeneralRe: Dialog boxes and views Pin
Sitaram Sukumar11-Dec-03 22:20
Sitaram Sukumar11-Dec-03 22:20 
GeneralRe: Dialog boxes and views Pin
Antti Keskinen12-Dec-03 1:27
Antti Keskinen12-Dec-03 1:27 
GeneralRe: Dialog boxes and views Pin
Sitaram Sukumar14-Dec-03 18:52
Sitaram Sukumar14-Dec-03 18:52 
GeneralRe: Dialog boxes and views Pin
Antti Keskinen15-Dec-03 0:25
Antti Keskinen15-Dec-03 0:25 
GeneralRe: Dialog boxes and views Pin
Balkrishna Talele12-Dec-03 0:28
Balkrishna Talele12-Dec-03 0:28 
Generalsaving private processor Pin
R. Thomas11-Dec-03 21:03
R. Thomas11-Dec-03 21:03 
hi, below is my on draw...
it works fine as below...

code:
--------------------------------------------------------------------------------
void CEditorView::OnDraw(CDC* dc)
{
CMemDC pDC(dc);
OnPrepareDC(pDC);
CEditorDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here - use pDC
//as the device context to draw to

//
//Set the mapping mode to LOENGLISH
//
pDC->SetMapMode(MM_LOENGLISH);

//
//Convert arguments to coordinates to MM_LOENGLISH units.
//
CSize szTemp;
szTemp.cx = pDoc->GetGridX();
szTemp.cy = pDoc->GetGridY();
pDC->DPtoLP(&szTemp);


//
// then draw the grid lines
//
CRect clipBoxRect;
pDC->GetClipBox(&clipBoxRect);
for(int x = 10 ; x <= pDoc->GetGridX() ; x += 10) {
pDC->MoveTo(x, -10);
pDC->LineTo(x, -pDoc->GetGridY());
}

for(int y = -10 ; y >= -pDoc->GetGridY() ; y -=10) {
pDC->MoveTo(10, y);
pDC->LineTo(pDoc->GetGridX(), y);
}
}--------------------------------------------------------------------------------

it works perfectly fine as below....
now the problem is i wanan add this to my above code

code:
--------------------------------------------------------------------------------
//
//Draw the squares
//
/*for(int i = 0 ; i < 500 ; i ++) {
for(int j = 0 ; j < 750 ; j ++) {
COLORREF color = pDoc->GetSquareColor(i, j);
CBrush brush(color);
int x1 = (j * 10) + 10;
int y1 = (i * -10) - 10;
int x2 = x1 + 10;
int y2 = y1 - 10;
CRect rect(x1, y1, x2, y2);
pDC->FillRect(rect, &brush);
}
}*/--------------------------------------------------------------------------------

when i do this...
all the processing power of the processor is eaten up by the processor....
can someone pls tell me a solution by which i can incorporate the above code to my View's OnDraw such that i can still retain my processing power????
tks a lot...

Have a Super Blessed Day!
-------------------------
For God has not given us a spirit of fear, but of power and of love and of a sound mind.
2 Timothy 1:7
"For God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life."
John 3:16
"Therefore you also be ready, for the Son of Man is coming at an hour you do not expet."
Luke 12:40

GeneralRe: saving private processor Pin
Peter Molnar12-Dec-03 9:59
Peter Molnar12-Dec-03 9:59 
Questionhow get CComboBox input Pin
google7311-Dec-03 20:15
google7311-Dec-03 20:15 
AnswerRe: how get CComboBox input Pin
l a u r e n11-Dec-03 20:26
l a u r e n11-Dec-03 20:26 
GeneralRe: how get CComboBox input Pin
google7311-Dec-03 21:13
google7311-Dec-03 21:13 
GeneralRe: how get CComboBox input Pin
Lido Paul11-Dec-03 21:45
Lido Paul11-Dec-03 21:45 
GeneralRe: how get CComboBox input Pin
google7311-Dec-03 22:40
google7311-Dec-03 22:40 
GeneralRe: how get CComboBox input Pin
Cedric Moonen12-Dec-03 1:14
Cedric Moonen12-Dec-03 1:14 
GeneralRe: how get CComboBox input Pin
Lido Paul13-Dec-03 14:14
Lido Paul13-Dec-03 14:14 
QuestionHow to detect driver's read/write attribute Pin
Lido Paul11-Dec-03 19:51
Lido Paul11-Dec-03 19:51 
QuestionHow to convert hWnd to CWnd Pin
Anonymous11-Dec-03 19:24
Anonymous11-Dec-03 19:24 
AnswerRe: How to convert hWnd to CWnd Pin
Jon Sagara11-Dec-03 19:43
Jon Sagara11-Dec-03 19:43 
AnswerRe: How to convert hWnd to CWnd Pin
Balkrishna Talele12-Dec-03 0:24
Balkrishna Talele12-Dec-03 0:24 
Generalenumeration of network &amp; local printer from win 98 client machine Pin
skpanda11-Dec-03 19:21
skpanda11-Dec-03 19:21 
QuestionCan we find the address of pop3 server from an email address? Pin
huqian200211-Dec-03 18:50
huqian200211-Dec-03 18:50 
AnswerRe: Can we find the address of pop3 server from an email address? Pin
Johnny ²11-Dec-03 21:44
Johnny ²11-Dec-03 21:44 
QuestionWhat is needed for programming a VC project about WMA audio format? Pin
zhaopzhi11-Dec-03 18:27
zhaopzhi11-Dec-03 18:27 
AnswerRe: What is needed for programming a VC project about WMA audio format? Pin
Alexander M.,12-Dec-03 2:47
Alexander M.,12-Dec-03 2:47 

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.