0

Is it possible to take a DLGTEMPLATE and use it as a CWnd-derived control for placing in any other CWnd?

I have a dialog template that I want to use on one of my CDockablePanes

Daniel A. White
  • 187,200
  • 47
  • 362
  • 445

1 Answers1

0

Your question isn't clear, please rephrase. If you're asking if it's possible to instantiate a control from a DLGTEMPLATE and put that instantiation on another dialog or as the child of another control, then yes, it is. It's a major PITA though, read through the Old New Thing blog (the series on dialog templates) if you want to know the details. If you just want to get it to work, use the CDlgTempl class from one of the MSDN samples; start here: http://support.microsoft.com/kb/155257. It won't make CWnd-derived controls but they're not what you want if you're asking what I think you are; you'll get a CDialog-derived object (which is itself derived from CWnd obviously, so in that sense it does give you what you ask).

Roel
  • 19,338
  • 6
  • 61
  • 90
  • link to Microsoft support article results in page not found. – Richard Chambers Feb 28 '19 at 03:11
  • Ironically, googling 'CDlgTempl' shows this page in the first 10 results, but it also shows a few other locations online where you can download it. It seems all the KB articles are disappearing. It's very hard nowadays to learn about MFC/win32 programming from scratch, most resources and samples are gone. – Roel Feb 28 '19 at 03:17
  • Yes, it looks like MFC is becoming more of a historical curiosity though I suspect there is a lot of MFC source code out in the wild that is being maintained. From an answer I did on how to install MFC with Visual Studio 2017 and the number of upvotes, there are a significant number of programmers maintaining MFC apps and moving to the latest Visual Studio as part of that effort. I'm in that boat with a MFC application that started with VS 6.x then to VS 2005 and now moving to VS 2015 and probably to VS 2017 some time later this year. – Richard Chambers Feb 28 '19 at 03:27
  • 1
    Maybe one day we'll get to charge extra for all that time we've spend putting up with all this nonsense... – Roel Feb 28 '19 at 03:29