Click here to Skip to main content
16,008,175 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Should Contextual menu show mnemonics ? Pin
Maximilien14-Mar-02 13:15
Maximilien14-Mar-02 13:15 
Questionl,Winsock Spy? Pin
Aaron Schaefer14-Mar-02 8:56
Aaron Schaefer14-Mar-02 8:56 
AnswerRe: l,Winsock Spy? Pin
Tomasz Sowinski14-Mar-02 9:17
Tomasz Sowinski14-Mar-02 9:17 
AnswerRe: l,Winsock Spy? Pin
Jon Hulatt15-Mar-02 0:48
Jon Hulatt15-Mar-02 0:48 
Questionl,Winsock Spy? Pin
Aaron Schaefer14-Mar-02 8:55
Aaron Schaefer14-Mar-02 8:55 
GeneralMFC Regular DLLs and Handle Maps Pin
Dave Glick14-Mar-02 8:20
Dave Glick14-Mar-02 8:20 
GeneralRe: MFC Regular DLLs and Handle Maps Pin
Tomasz Sowinski14-Mar-02 8:42
Tomasz Sowinski14-Mar-02 8:42 
GeneralRe: MFC Regular DLLs and Handle Maps Pin
Dave Glick14-Mar-02 8:55
Dave Glick14-Mar-02 8:55 
Could you describe this step in more detailed fashion?

Sure - First I have a LRESULT CALLBACK MyWndProc() function that I've set up to process messages, I'll describe it more specificaly in a moment.

I create a CButton and then call ::SetClassLong using GCL_WNDPROC as the argument and then I store the return value for use in MyWndProc.

Inside MyWndProc, I watch for WM_PAINT messages (because this is the first message that gets sent after MFC has actually added it's member variables to the permanent message map - and because after I subclass, WM_PAINT won't get sent anymore for my ownerdrawn buttons) and when I find one, I create a new CoolButton and tell it to subclass the Wnd. It's in this step that I would unattach the member CButton from the application's permanent message map if I had access to it (In fact, the unattach is essential if this code is to be run from the application itself since a handle map can not have two MFC classes pointing to the same window handle).

Was this what you were looking for?

WM_KILLFOCUS is sent (not posted through message loop/pump).

My bad - in any case, it ends up going through my WndProc and then being sent on to the default one, which is what causes the crash when a member variable exists.

Thanks,

Dave
GeneralRe: MFC Regular DLLs and Handle Maps Pin
Tomasz Sowinski14-Mar-02 9:27
Tomasz Sowinski14-Mar-02 9:27 
GeneralWrong app icon used in explorer Pin
Jason Hihn14-Mar-02 8:19
Jason Hihn14-Mar-02 8:19 
Generalpdf about win32 Pin
DiegoValdevino14-Mar-02 7:57
DiegoValdevino14-Mar-02 7:57 
GeneralRe: pdf about win32 Pin
14-Mar-02 21:03
suss14-Mar-02 21:03 
QuestionHow to use WM_COPY? Pin
Pony14-Mar-02 7:21
Pony14-Mar-02 7:21 
AnswerRe: How to use WM_COPY? Pin
Dave Glick14-Mar-02 8:25
Dave Glick14-Mar-02 8:25 
AnswerRe: How to use WM_COPY? Pin
Tomasz Sowinski14-Mar-02 8:57
Tomasz Sowinski14-Mar-02 8:57 
GeneralToolbars status Pin
Paolo Vernazza14-Mar-02 6:00
Paolo Vernazza14-Mar-02 6:00 
GeneralRe: Toolbars status Pin
Alexander Wiseman14-Mar-02 6:11
Alexander Wiseman14-Mar-02 6:11 
GeneralRe: Toolbars status Pin
Paolo Vernazza14-Mar-02 12:08
Paolo Vernazza14-Mar-02 12:08 
GeneralRe: Toolbars status Pin
Alexander Wiseman14-Mar-02 12:24
Alexander Wiseman14-Mar-02 12:24 
GeneralRe: Toolbars status Pin
Paolo Vernazza15-Mar-02 1:22
Paolo Vernazza15-Mar-02 1:22 
GeneralRe: Toolbars status Pin
Alexander Wiseman15-Mar-02 15:38
Alexander Wiseman15-Mar-02 15:38 
GeneralMulti-threaded app connecting to db, Design Question Pin
14-Mar-02 5:55
suss14-Mar-02 5:55 
GeneralRe: Multi-threaded app connecting to db, Design Question Pin
Joaquín M López Muñoz14-Mar-02 6:21
Joaquín M López Muñoz14-Mar-02 6:21 
GeneralRe: Multi-threaded app connecting to db, Design Question Pin
14-Mar-02 12:59
suss14-Mar-02 12:59 
GeneralRe: Multi-threaded app connecting to db, Design Question Pin
Joaquín M López Muñoz14-Mar-02 19:59
Joaquín M López Muñoz14-Mar-02 19:59 

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.