Solved

MFC Window Procedure

Posted on 1998-12-09
2
254 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
how do i create updater to My Activex application? 3 102
has77  challenge 9 99
child constructor and parent constructor, overriding and overloading 6 93
fix34  challenge 9 167
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

730 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