Solved

MFC Window Procedure

Posted on 1998-12-09
2
216 Views
Last Modified: 2013-11-20
With 32-bit version of MFC, Windows classes are no longer registered with the AfxWndProc() function - instead they are registered with DefWindowProc() as the message handler. However, AfxWndProc() is still there and it dispatches messages to various CWnd derived objects. My question is:
What is the main purpose behind using DefWindowProc() as the registered window procedure and yet how do messages end up in AfxWndProc()?
0
Comment
Question by:a_turtle
2 Comments
 
LVL 4

Accepted Solution

by:
pagladasu earned 150 total points
ID: 1325965
The primary reason as to why Microsoft shifted from using AfxWndProc() as the registered window procedure to using DefWindowProc() is to support 3D Controls, which works through Microsoft's CTL3D.DLL. In order to have CTL3D functionality,
MFC registers everything with DefWindowProc(), then during _AfxStandardSubclass(), hooks up CTL3D, and then finally adds a subclass on top of CTL3D by installing AfxWndProc().

Thanks.
pagladasu
0
 

Author Comment

by:a_turtle
ID: 1325966
Thanks. Could you please explain in more details about what really happens.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Powershell based monitoring system 2 127
VB.NET how to use the Vertical ScrollBar 5 87
Perl Awk Need Help 3 94
fix34  challenge 9 96
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now