Click here to Skip to main content
15,896,063 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Staring with a Dialog Pin
manustone11-Dec-06 11:28
manustone11-Dec-06 11:28 
Questiondll creation from cpp files Pin
NAB3711-Dec-06 9:41
NAB3711-Dec-06 9:41 
QuestionI can't debug an MFC app anymore Pin
pblais11-Dec-06 8:25
pblais11-Dec-06 8:25 
AnswerRe: I can't debug an MFC app anymore Pin
pblais11-Dec-06 8:29
pblais11-Dec-06 8:29 
AnswerRe: I can't debug an MFC app anymore Pin
Michael Dunn11-Dec-06 9:05
sitebuilderMichael Dunn11-Dec-06 9:05 
GeneralThanks Mike Pin
pblais11-Dec-06 9:18
pblais11-Dec-06 9:18 
GeneralRe: Thanks Mike Pin
Michael Dunn11-Dec-06 10:51
sitebuilderMichael Dunn11-Dec-06 10:51 
QuestionNeed Help w/ Drawing to DC and then Blitting It Pin
CoffeeAddict1911-Dec-06 8:15
CoffeeAddict1911-Dec-06 8:15 
What I'm trying to do is draw a background in a memory device context, and then blit it onto the window when necessary. There is no reason to redraw the background every time OnPaint() runs, so I think I would get better performance if I just drew the background once in memory, then blit the whole thing every time the screen needs to refresh. The program is running without any errors, but "It Works!" is not rendering on the screen. I'd appreciate any help. Are there any good books on this? Mine aren't very good.

Relavent part of implementation file:
void CGameWin::DrawBackground(CDC &dc)
{
CRect ItWorksDimensions;

mem_DC.CreateCompatibleDC(&dc);
ItWorksDimensions.left = 0;
ItWorksDimensions.top = 0;
ItWorksDimensions.right = 70;
ItWorksDimensions.bottom = 20;
mem_DC.DrawText("It Works!", ItWorksDimensions, DT_CENTER);
}
afx_msg void CGameWin::OnPaint()
{
CPaintDC Screen(this);
CRect WindowArea;

GetClientRect(&WindowArea);
OffSetX = WindowArea.right / 4;
OffSetY = WindowArea.bottom / 4;
DrawBackground(Screen);
Screen.BitBlt(OffSetX, OffSetY, 70, 20, &mem_DC, 0, 0, SRCCOPY);
}

Relavent part of header file:

class CGameWin : public CFrameWnd
{
public:
CGameWin();
afx_msg void OnPaint();
//file menu "File"
afx_msg void OnExit();

private:
void DrawBackground(CDC &dc);
CDC mem_DC; //memory device context
CGameKeyBindingDialog CGameKeyBindingDialog;
int OffSetX;
int OffSetY;

DECLARE_MESSAGE_MAP()
};
AnswerRe: Need Help w/ Drawing to DC and then Blitting It Pin
Mark Salsbery11-Dec-06 8:28
Mark Salsbery11-Dec-06 8:28 
QuestionSaving question Pin
DanYELL11-Dec-06 6:20
DanYELL11-Dec-06 6:20 
AnswerRe: Saving question Pin
Sam Hobbs11-Dec-06 18:56
Sam Hobbs11-Dec-06 18:56 
QuestionMFC UI Threads Pin
rrrado11-Dec-06 5:19
rrrado11-Dec-06 5:19 
AnswerRe: MFC UI Threads Pin
Mark Salsbery11-Dec-06 5:33
Mark Salsbery11-Dec-06 5:33 
GeneralRe: MFC UI Threads Pin
rrrado11-Dec-06 5:42
rrrado11-Dec-06 5:42 
GeneralRe: MFC UI Threads Pin
Mark Salsbery11-Dec-06 6:09
Mark Salsbery11-Dec-06 6:09 
GeneralRe: MFC UI Threads Pin
rrrado11-Dec-06 6:48
rrrado11-Dec-06 6:48 
GeneralRe: MFC UI Threads [modified] Pin
Mark Salsbery11-Dec-06 7:04
Mark Salsbery11-Dec-06 7:04 
GeneralRe: MFC UI Threads Pin
rrrado11-Dec-06 7:37
rrrado11-Dec-06 7:37 
GeneralRe: MFC UI Threads Pin
Mark Salsbery11-Dec-06 7:09
Mark Salsbery11-Dec-06 7:09 
AnswerRe: MFC UI Threads Pin
Michael Dunn11-Dec-06 7:17
sitebuilderMichael Dunn11-Dec-06 7:17 
GeneralRe: THANK YOU Pin
rrrado11-Dec-06 7:35
rrrado11-Dec-06 7:35 
AnswerRe: MFC UI Threads Pin
Sunil P V11-Dec-06 18:46
Sunil P V11-Dec-06 18:46 
QuestionLooking for Charting Packages Pin
Jethro6311-Dec-06 4:08
Jethro6311-Dec-06 4:08 
QuestionOnMouseWheel() vs OnVScroll() Pin
Jesper Knudsen11-Dec-06 3:49
Jesper Knudsen11-Dec-06 3:49 
AnswerRe: OnMouseWheel() vs OnVScroll() [modified] Pin
prasad_som11-Dec-06 4:41
prasad_som11-Dec-06 4:41 

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.