Click here to Skip to main content
15,893,814 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: VMR9 & SampleGrabber at the same time , how ? Pin
Mark Salsbery2-Jul-07 12:28
Mark Salsbery2-Jul-07 12:28 
QuestionWhat is dlg subclass ? Pin
prithaa2-Jul-07 8:21
prithaa2-Jul-07 8:21 
AnswerRe: What is dlg subclass ? Pin
David Crow2-Jul-07 8:32
David Crow2-Jul-07 8:32 
AnswerRe: What is dlg subclass ? Pin
Mark Salsbery2-Jul-07 9:06
Mark Salsbery2-Jul-07 9:06 
GeneralRe: What is dlg subclass ? Pin
prithaa3-Jul-07 0:36
prithaa3-Jul-07 0:36 
GeneralRe: What is dlg subclass ? Pin
Mark Salsbery3-Jul-07 5:50
Mark Salsbery3-Jul-07 5:50 
GeneralRe: What is dlg subclass ? Pin
prithaa3-Jul-07 23:35
prithaa3-Jul-07 23:35 
GeneralRe: What is dlg subclass ? Pin
Mark Salsbery4-Jul-07 6:20
Mark Salsbery4-Jul-07 6:20 
prithaa wrote:
You said that
Once a dialog and its items (controls) have been created then you can subclass them.


In order to subclass a window (or control) it needs to have an HWND. That means the window has to
exist (be created) before you can subclass it.

Reminder/Note: In MFC, windows are created in two steps -
1) A C++ object (CWnd) is created
2) A window object (HWND) is created

To attach an MFC C++ object (CWnd) to a control in a dynamically created dialog (which already
has a valid HWND), you need to force the subclass to occur (usually this is done by the MFC DDE
mechanism), which is what you use CWnd::SubclassDlgItem() for. Once MFC has the control
subclassed, it can pass messages through the message map mechanism as usual.

You don't HAVE to subclass the controls of the dynamically created dialog. You only need to do
it if you need to associate them with an MFC object or provide special message handling beyond
what the control already does.

Mark


Mark Salsbery
Microsoft MVP - Visual C++


"Go that way, really fast. If something gets in your way, turn."

QuestionA simple question Pin
paulosuckow2-Jul-07 7:29
paulosuckow2-Jul-07 7:29 
QuestionInfinite value in C++ Pin
includeh102-Jul-07 6:18
includeh102-Jul-07 6:18 
AnswerRe: Infinite value in C++ Pin
Eytukan2-Jul-07 6:22
Eytukan2-Jul-07 6:22 
GeneralRe: Infinite value in C++ Pin
includeh102-Jul-07 6:38
includeh102-Jul-07 6:38 
GeneralRe: Infinite value in C++ Pin
Hamid_RT2-Jul-07 7:52
Hamid_RT2-Jul-07 7:52 
GeneralRe: Infinite value in C++ Pin
includeh102-Jul-07 8:30
includeh102-Jul-07 8:30 
GeneralRe: Infinite value in C++ Pin
Hamid_RT2-Jul-07 9:16
Hamid_RT2-Jul-07 9:16 
AnswerRe: Infinite value in C++ Pin
David Crow2-Jul-07 8:36
David Crow2-Jul-07 8:36 
Questionresizing child windows Pin
sdancer752-Jul-07 5:30
sdancer752-Jul-07 5:30 
AnswerRe: resizing child windows Pin
David Crow2-Jul-07 5:34
David Crow2-Jul-07 5:34 
AnswerRe: resizing child windows Pin
Mark Salsbery2-Jul-07 5:53
Mark Salsbery2-Jul-07 5:53 
GeneralRe: resizing child windows Pin
sdancer752-Jul-07 22:17
sdancer752-Jul-07 22:17 
AnswerRe: resizing child windows Pin
Hamid_RT2-Jul-07 7:54
Hamid_RT2-Jul-07 7:54 
QuestionRTL Pin
Try2-Jul-07 4:55
Try2-Jul-07 4:55 
AnswerRe: RTL Pin
katreddi.lakshmi16-Jun-10 2:21
katreddi.lakshmi16-Jun-10 2:21 
Questionpointer problem :) Pin
ajitatif angajetor2-Jul-07 4:34
ajitatif angajetor2-Jul-07 4:34 
AnswerRe: pointer problem :) Pin
CPallini2-Jul-07 5:14
mveCPallini2-Jul-07 5:14 

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.