I am working with a third party application manager. In their documentation, I need to handle their messages by calling their method ami_GetMessage() as follows:
WndProc(hWnd, message, wParam, lParam)
{
switch (message)
{
// handle window messages here
default:
message_type = ami_GetMessage(message, wParam, lParam);
....
}
}
However, my application is an MFC app which uses message maps and not WndProc(). Is it possible to use WndProc() in an MFC app If so, how.
Thanks

WndProc() in MFC
Gert Christiansen
See http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=789657&SiteID=1 and http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=980773&SiteID=1. This question is not within the scope of this forum. Please direct further similar SDK issues to a suitable newsgroup at http://msdn.microsoft.com/newsgroups.
That being said ...
To give you a pointer on what to do, you can either use the message map to capture the specific messages your third party library expects, and send these to ami_GetMessage.
Another solution is to override the WindowProc function of your window / dialog class, and forward messages from there. The function should be declared within your class definition, like the one at http://msdn2.microsoft.com/en-gb/library/8k57wfbs(vs.80).aspx. Be sure to call the original (overridden) CWnd::WindowProc, if you want messages to be delivered through your message map aswell (and you'd really like that).
A third posibility is to override DefWindowProc (http://msdn2.microsoft.com/en-us/library/3323tewb(vs.80).aspx), and pass on messages which aren't handled by the message map. Be sure to call the original (overridden) CWnd::DefWindowProc, aswell.
Which one of these three solutions you should pick, would depend on exactly which messages the third party library expects you to pass on. Consult the documentation, then consider which action gets you where. For further questions on this matter, please use one of the newsgroups indicated in the initial pages linked. Thanks!