Click here to Skip to main content
16,011,685 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Printer Control Pin
led mike6-Jan-07 18:55
led mike6-Jan-07 18:55 
AnswerRe: Printer Control Pin
Rajesh R Subramanian7-Jan-07 18:34
professionalRajesh R Subramanian7-Jan-07 18:34 
QuestionAutomatically Startup... Pin
M266-Jan-07 10:44
M266-Jan-07 10:44 
AnswerRe: Automatically Startup... Pin
Mark Salsbery6-Jan-07 11:27
Mark Salsbery6-Jan-07 11:27 
GeneralRe: Automatically Startup... Pin
Alexander M.,6-Jan-07 13:32
Alexander M.,6-Jan-07 13:32 
AnswerRe: Automatically Startup... Pin
Bram van Kampen6-Jan-07 15:37
Bram van Kampen6-Jan-07 15:37 
AnswerRe: Automatically Startup... Pin
S Douglas6-Jan-07 21:14
professionalS Douglas6-Jan-07 21:14 
QuestionIssue with SetBitmap Pin
CoffeeAddict196-Jan-07 8:33
CoffeeAddict196-Jan-07 8:33 
I'm trying to change the face of a button to a solid color bitmap, but for some reason it's just displaying the button without the bitmap on the front. Here is the code:

CGameOptionsDialog::CGameOptionsDialog(char* lpszName) : CDialog(lpszName)
{
	//initialize graphics
	Problem = mem_DC.CreateCompatibleDC(NULL);
	CBitSolidBkButton.CreateBitmap(20, 20, mem_DC.GetDeviceCaps(PLANES), mem_DC.GetDeviceCaps(BITSPIXEL), NULL);
	mem_DC.SelectObject(CBitSolidBkButton);
	NewSolidBkColor = RGB(220, 20, 60); //default
	NewSolidBkBrush.CreateSolidBrush(NewSolidBkColor);
	mem_DC.SelectObject(NewSolidBkBrush);
	mem_DC.FloodFill(0, 0, NewSolidBkColor);
}


and where SetBitmap is called...

BOOL CGameOptionsDialog::OnInitDialog()
{
	CDialog::OnInitDialog();

...

//initialize controls
	SolidColorSelectButton.Create(" ", WS_CHILD|WS_VISIBLE|BS_BITMAP, CRect(145, 55, 165, 75), this, ID_CHANGE_BK_COLOR);
	Gradient1ColorSelectButton.Create(" ", WS_CHILD|WS_VISIBLE|BS_BITMAP, CRect(145, 85, 165, 105), this, ID_CHANGE_GRADIENT1_COLOR);
	Gradient2ColorSelectButton.Create(" ", WS_CHILD|WS_VISIBLE|BS_BITMAP, CRect(175, 85, 195, 105), this, ID_CHANGE_GRADIENT2_COLOR);
	SolidColorSelectButton.SetBitmap((HBITMAP)CBitSolidBkButton);

if(Problem == FALSE)
        MessageBox("Problem", "MSG", MB_OK);

        return TRUE;
}
</code>


The "Problem" message box isn't popping up, so I'm pretty shure that the device context got initialized right (it's a class member, so scope isn't an issue). Any ideas on what is wrong? Thanks.
AnswerRe: Issue with SetBitmap Pin
Warren Stevens6-Jan-07 10:14
Warren Stevens6-Jan-07 10:14 
GeneralRe: Issue with SetBitmap Pin
CoffeeAddict196-Jan-07 11:52
CoffeeAddict196-Jan-07 11:52 
QuestionWhat is the message that occur when user press enter? Pin
Max++6-Jan-07 6:58
Max++6-Jan-07 6:58 
AnswerRe: What is the message that occur when user press enter? Pin
Mark Salsbery6-Jan-07 7:25
Mark Salsbery6-Jan-07 7:25 
AnswerRe: What is the message that occur when user press enter? Pin
Warren Stevens6-Jan-07 10:06
Warren Stevens6-Jan-07 10:06 
Questionunsigned int 12 bits Pin
ikbahrian6-Jan-07 3:59
ikbahrian6-Jan-07 3:59 
AnswerRe: unsigned int 12 bits Pin
CPallini6-Jan-07 4:18
mveCPallini6-Jan-07 4:18 
GeneralRe: unsigned int 12 bits Pin
ikbahrian6-Jan-07 4:23
ikbahrian6-Jan-07 4:23 
QuestionOK. What are the ranges? Pin
CPallini6-Jan-07 4:45
mveCPallini6-Jan-07 4:45 
AnswerRe: OK. What are the ranges? Pin
ikbahrian6-Jan-07 5:11
ikbahrian6-Jan-07 5:11 
GeneralRe: OK. What are the ranges? Pin
Dominik Reichl6-Jan-07 6:08
Dominik Reichl6-Jan-07 6:08 
GeneralRe: OK. What are the ranges? Pin
CPallini6-Jan-07 6:27
mveCPallini6-Jan-07 6:27 
AnswerRe: unsigned int 12 bits [modified] Pin
Jörgen Sigvardsson6-Jan-07 6:07
Jörgen Sigvardsson6-Jan-07 6:07 
GeneralRe: unsigned int 12 bits Pin
Mark Salsbery6-Jan-07 6:17
Mark Salsbery6-Jan-07 6:17 
GeneralRe: unsigned int 12 bits Pin
Jörgen Sigvardsson6-Jan-07 6:43
Jörgen Sigvardsson6-Jan-07 6:43 
GeneralRe: unsigned int 12 bits Pin
Mark Salsbery6-Jan-07 6:44
Mark Salsbery6-Jan-07 6:44 
GeneralRe: unsigned int 12 bits Pin
ikbahrian7-Jan-07 3:22
ikbahrian7-Jan-07 3:22 

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.