Click here to Skip to main content
15,917,060 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to modify just a line of text in a file? Pin
sysmatrix26-Feb-04 9:30
sysmatrix26-Feb-04 9:30 
AnswerRe: How to modify just a line of text in a file? Pin
David Crow26-Feb-04 10:59
David Crow26-Feb-04 10:59 
GeneralRe: How to modify just a line of text in a file? Pin
Rajesh match26-Feb-04 18:45
Rajesh match26-Feb-04 18:45 
AnswerRe: How to modify just a line of text in a file? Pin
Selvam R26-Feb-04 19:07
professionalSelvam R26-Feb-04 19:07 
Questionmap a network drive? Pin
Joan M26-Feb-04 9:10
professionalJoan M26-Feb-04 9:10 
AnswerRe: map a network drive? Pin
David Crow26-Feb-04 10:55
David Crow26-Feb-04 10:55 
AnswerRe: map a network drive? Pin
raj_v26-Feb-04 13:08
raj_v26-Feb-04 13:08 
GeneralOpening a Dialog: Accessing Main Window Pin
johnsb226-Feb-04 8:51
johnsb226-Feb-04 8:51 
GeneralRe: Opening a Dialog: Accessing Main Window Pin
pgrohs26-Feb-04 9:09
pgrohs26-Feb-04 9:09 
GeneralRe: Opening a Dialog: Accessing Main Window Pin
johnsb226-Feb-04 11:07
johnsb226-Feb-04 11:07 
GeneralRe: Opening a Dialog: Accessing Main Window Pin
PJ Arends26-Feb-04 16:40
professionalPJ Arends26-Feb-04 16:40 
Generalhi need help with autorun.exe program!! Pin
gelcoman26-Feb-04 8:26
gelcoman26-Feb-04 8:26 
GeneralRe: hi need help with autorun.exe program!! Pin
pgrohs26-Feb-04 9:13
pgrohs26-Feb-04 9:13 
GeneralRe: hi need help with autorun.exe program!! Pin
gelcoman26-Feb-04 9:26
gelcoman26-Feb-04 9:26 
GeneralQuestion anbout DLLs and heaps... Pin
CherezZaboro26-Feb-04 7:49
CherezZaboro26-Feb-04 7:49 
GeneralRe: Question anbout DLLs and heaps... Pin
Tim Smith26-Feb-04 8:29
Tim Smith26-Feb-04 8:29 
GeneralRe: Question anbout DLLs and heaps... Pin
CherezZaboro26-Feb-04 8:46
CherezZaboro26-Feb-04 8:46 
GeneralRe: Question anbout DLLs and heaps... Pin
Nemanja Trifunovic26-Feb-04 10:59
Nemanja Trifunovic26-Feb-04 10:59 
GeneralDouble Buffering in SDI Pin
hntay26-Feb-04 6:57
hntay26-Feb-04 6:57 
Hi,

I have tried looking at the examples available here but they don't seem to work for me. I have a SDI project on the go and I have a drawing window on the top right corner that I would like refreshed periodically. I want to double buffer it and this is what I have so far in my CDoubleBufferView::OnPaint()

CRect tempRect;
GetClientRect(tempRect); //rect of the window

CPaintDC dc(this);
CBitmap bitmap;
CDC dcMem;

if(m_isDoubleBuffered)
{
if( dcMem.CreateCompatibleDC( &dc ) ) {
bitmap.CreateCompatibleBitmap(&dc, tempRect.Width(), tempRect.Height() );
CBitmap* pOldBitmap = dcMem.SelectObject(&bitmap);
dcMem.FillSolidRect(tempRect, dc.GetBkColor());
Draw(dcMem);
dc.BitBlt( tempRect.left,
tempRect.top,
tempRect.Width(),
tempRect.Height(),
&dcMem,
tempRect.left,
tempRect.top,
SRCCOPY );
dc.SetTextColor(RGB(255, 255, 255));
dc.SetBkMode(TRANSPARENT);
dc.SetTextAlign(TA_LEFT | TA_TOP);
dc.TextOut(m_dwTopLeft.x, m_dwTopLeft.y, "Double Buffer");
}
}
else
{
Draw(dc);
dc.SetTextColor(RGB(255, 255, 255));
dc.SetBkMode(TRANSPARENT);
dc.SetTextAlign(TA_LEFT | TA_TOP);
dc.TextOut(m_dwTopLeft.x, m_dwTopLeft.y, "No Double Buffer");
}

I do not see any difference in either mode. Did I miss something. Btw, I am still new with MFC, thus if a more detailed explanation can be provided, it would be greatly appreciated. Thanks in advance.


GeneralRe: Double Buffering in SDI Pin
alex.barylski26-Feb-04 15:03
alex.barylski26-Feb-04 15:03 
GeneralSetDlgItemText Problem Pin
Caoimh26-Feb-04 5:42
Caoimh26-Feb-04 5:42 
GeneralRe: SetDlgItemText Problem Pin
Prakash Nadar26-Feb-04 5:46
Prakash Nadar26-Feb-04 5:46 
GeneralProgramming in C++ with .NET Pin
Jerome Conus26-Feb-04 5:33
Jerome Conus26-Feb-04 5:33 
GeneralRe: Programming in C++ with .NET Pin
Michael P Butler26-Feb-04 5:48
Michael P Butler26-Feb-04 5:48 
GeneralAutolist member option in VStudio 6 Pin
Jerome Conus26-Feb-04 5:30
Jerome Conus26-Feb-04 5:30 

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.