Click here to Skip to main content
15,897,518 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Is CString really based on TCHAR? Pin
Rajesh R Subramanian30-Jul-11 22:44
professionalRajesh R Subramanian30-Jul-11 22:44 
Questionbasic C struct newbee question Pin
Member 811717127-Jul-11 9:01
Member 811717127-Jul-11 9:01 
GeneralRe: basic C struct newbee question Pin
David Crow27-Jul-11 10:14
David Crow27-Jul-11 10:14 
GeneralRe: basic C struct newbee question Pin
Member 811717127-Jul-11 10:38
Member 811717127-Jul-11 10:38 
GeneralRe: basic C struct newbee question Pin
David Crow27-Jul-11 10:52
David Crow27-Jul-11 10:52 
GeneralRe: basic C struct newbee question Pin
Albert Holguin27-Jul-11 12:09
professionalAlbert Holguin27-Jul-11 12:09 
GeneralRe: basic C struct newbee question Pin
Maximilien27-Jul-11 13:13
Maximilien27-Jul-11 13:13 
AnswerRe: basic C struct newbee question Pin
Maximilien27-Jul-11 10:21
Maximilien27-Jul-11 10:21 
AnswerRe: basic C struct newbee question Pin
Albert Holguin27-Jul-11 10:26
professionalAlbert Holguin27-Jul-11 10:26 
GeneralRe: basic C struct newbee question Pin
Member 811717127-Jul-11 10:34
Member 811717127-Jul-11 10:34 
GeneralRe: basic C struct newbee question Pin
Albert Holguin27-Jul-11 12:12
professionalAlbert Holguin27-Jul-11 12:12 
AnswerRe: basic C struct newbee question Pin
«_Superman_»27-Jul-11 10:59
professional«_Superman_»27-Jul-11 10:59 
QuestionHow to Validate User's Password Pin
rick222227-Jul-11 7:53
rick222227-Jul-11 7:53 
AnswerRe: How to Validate User's Password Pin
Rajesh R Subramanian27-Jul-11 8:09
professionalRajesh R Subramanian27-Jul-11 8:09 
GeneralRe: How to Validate User's Password Pin
rick222230-Jul-11 4:46
rick222230-Jul-11 4:46 
QuestionHow to create CMFCLinkCtrl hyperlink multiline? Pin
yogish29327-Jul-11 4:44
yogish29327-Jul-11 4:44 
AnswerRe: How to create CMFCLinkCtrl hyperlink multiline? Pin
«_Superman_»27-Jul-11 5:00
professional«_Superman_»27-Jul-11 5:00 
Questionhow to save file name with unicode format??? Pin
shashankacharya26-Jul-11 23:29
shashankacharya26-Jul-11 23:29 
QuestionRe: how to save file name with unicode format??? Pin
Rajesh R Subramanian27-Jul-11 0:06
professionalRajesh R Subramanian27-Jul-11 0:06 
AnswerRe: how to save file name with unicode format??? Pin
shashankacharya27-Jul-11 0:17
shashankacharya27-Jul-11 0:17 
AnswerRe: how to save file name with unicode format??? Pin
Rajesh R Subramanian27-Jul-11 0:22
professionalRajesh R Subramanian27-Jul-11 0:22 
AnswerRe: how to save file name with unicode format??? Pin
«_Superman_»27-Jul-11 4:35
professional«_Superman_»27-Jul-11 4:35 
GeneralRe: how to save file name with unicode format??? Pin
Rajesh R Subramanian27-Jul-11 5:32
professionalRajesh R Subramanian27-Jul-11 5:32 
JokeRe: how to save file name with unicode format??? Pin
«_Superman_»27-Jul-11 7:28
professional«_Superman_»27-Jul-11 7:28 
QuestionManaging PushButton notifications under MFC Pin
tiwal26-Jul-11 23:01
tiwal26-Jul-11 23:01 
Hello
I have the following question.

I am new at MFC (I am using it with VC ++ 6.0).
I am trying to create a very simple window with a PushButton on it, supposed to activate a messagebox whenever it's clicked.
The wizard set the application with a MainFrame class, a View derived class, a Doc derived class (it's a SDI) and the usual App class.
On my behalf I added a simple CButton derived class.
This class has a constructor which receives the button's coordinates, calls the base constructor CButton () and then the Create () method on those coordinates.
I instantiate the button derived object on the InitInstance() method of the App derived class.
This object is a heap object , so I first declare a pointer and then call the contructor with some coordinates.
The pushbutton appears regularly, but when it comes to managing the BN_CLICKED event,things begin to get confusing.
I added the ON_BN_CLICKED () macro to the parent window's message map (which is the View class object), as MSDN suggests, and gave it my personal message handler's overload.
Well it seems that the BN_CLICKED event is never triggered : all I can detect is WM_LBUTTONDOWN
which I can manage, but the problem is, this event is triggered whenever I click on the window, no matter if I click on the button or not.
My question is : why does MSDN state that BN_CLICKED is triggered when a push button is clicked ? What can I do to get that event triggered and possibly managed ?

To avoid misunderstandings, I want to make it clear that I am NOT using a pushbutton in a Dialog , but right in a main window.

Thank you

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.