Click here to Skip to main content
15,918,041 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Button Color In MFC Pin
JohnCz24-Apr-12 4:08
JohnCz24-Apr-12 4:08 
QuestionRe: Button Color In MFC Pin
David Crow24-Apr-12 6:04
David Crow24-Apr-12 6:04 
AnswerRe: Button Color In MFC Pin
JohnCz24-Apr-12 7:42
JohnCz24-Apr-12 7:42 
GeneralRe: Button Color In MFC Pin
enhzflep24-Apr-12 8:13
enhzflep24-Apr-12 8:13 
GeneralRe: Button Color In MFC Pin
JohnCz24-Apr-12 10:55
JohnCz24-Apr-12 10:55 
GeneralRe: Button Color In MFC Pin
002comp24-Apr-12 20:31
002comp24-Apr-12 20:31 
GeneralRe: Button Color In MFC Pin
002comp24-Apr-12 21:34
002comp24-Apr-12 21:34 
GeneralRe: Button Color In MFC Pin
JohnCz25-Apr-12 0:31
JohnCz25-Apr-12 0:31 
yogeshs,
I think you are confusing two things: Windows window with MFC object that is not a window.
MFC object encapsulates window handle and only after window handle is valid, such an object represent Windows window. There are three ways to make MFC object alive (assign a valid handle):

Calling member function Create for a given class
Calling Attach
Subclassing window

Only calling Create and Subclassing will allow MFC object handling messages of the attached window.
Calling Attach will not allow process any messages processing, since window procedure has not been replaced by the object’s window procedure.

You should post a snippet that shows a function where it assert. Your code snippet does not make much sense since the meaning of the GetDlgItemId is unknown. Regardless, it looks like you are trying to attach an object that is already alive, meaning Windows window has MFC object attached to it. MFC code does it for you.

Please answer one question that I have already asked: What version of Visual Studio you are using? Maybe taking it from here will be more beneficial for you.
JohnCz

GeneralRe: Button Color In MFC Pin
002comp25-Apr-12 3:05
002comp25-Apr-12 3:05 
AnswerRe: Button Color In MFC Pin
JohnCz25-Apr-12 3:47
JohnCz25-Apr-12 3:47 
GeneralRe: Button Color In MFC Pin
002comp25-Apr-12 7:51
002comp25-Apr-12 7:51 
GeneralRe: Button Color In MFC Pin
David Crow25-Apr-12 8:09
David Crow25-Apr-12 8:09 
GeneralRe: Button Color In MFC Pin
JohnCz26-Apr-12 2:28
JohnCz26-Apr-12 2:28 
QuestionRe: Button Color In MFC Pin
David Crow25-Apr-12 2:39
David Crow25-Apr-12 2:39 
AnswerRe: Button Color In MFC Pin
002comp25-Apr-12 7:55
002comp25-Apr-12 7:55 
QuestionReference return vs Pointer return Pin
Aragtey24-Apr-12 0:05
Aragtey24-Apr-12 0:05 
AnswerRe: Reference return vs Pointer return Pin
CPallini24-Apr-12 0:56
mveCPallini24-Apr-12 0:56 
AnswerRe: Reference return vs Pointer return Pin
enhzflep24-Apr-12 1:10
enhzflep24-Apr-12 1:10 
AnswerRe: Reference return vs Pointer return Pin
Aescleal24-Apr-12 1:55
Aescleal24-Apr-12 1:55 
GeneralRe: Reference return vs Pointer return Pin
Aragtey24-Apr-12 5:37
Aragtey24-Apr-12 5:37 
GeneralRe: Reference return vs Pointer return Pin
Aescleal24-Apr-12 6:31
Aescleal24-Apr-12 6:31 
GeneralRe: Reference return vs Pointer return Pin
Aragtey24-Apr-12 6:36
Aragtey24-Apr-12 6:36 
GeneralRe: Reference return vs Pointer return Pin
Aescleal25-Apr-12 5:19
Aescleal25-Apr-12 5:19 
QuestionBest approach to compare files Pin
MKC00223-Apr-12 23:37
MKC00223-Apr-12 23:37 
AnswerRe: Best approach to compare files Pin
sangamdumne23-Apr-12 23:49
sangamdumne23-Apr-12 23:49 

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.