I have a single document MFC app, which consists of the MainFrame
(derived from CFrameWnd) and within contained CChildView
(derived form CWnd). These are generated by the VS MFC Wizard.
In resource editor I have designed a simple UI and tagged it as IDD_CUSTOMCONTROL
with few buttons and text fields. I would like to connect it to the CChildView without generating it as a new dialog.
What is the right way to do it? Is it possible to do it? Or should I connect the ID directly to MainFrame
?
EDIT: I have just found the right MSDN page which states which classes can have dialog id's assigned.
The scope of the question is depleted. Can/should it be closed? Or can I ask how to achieve my goal and apply the designed resource to MainFrame? (The title is now misleading).
CWnd
-derived class) displaying and modifying the "document" (callGetDocument()
).CView
is the base-class, whileCFormView
is the derivative that can display a dialog resource. So your view class must be derived fromCFormView
- and no, the frame window has nothing to do with resources or the document. As an advice, try to NOT#include
the view's header file (childview.h ?) in the document's source (the opposite is necessary, of course, ie the view must "know" the document). – Constantine GeorgiouCFormView
, which in my case is the MainFrame (Parent Window). As soon as I get this I will provide the answer to question together with the solution to the problem. – RafalCFormView
(the MainFrame could be left as is). Better create a new test project with the wizard, initially deriving the view fromCFormView
, to see how it is done. – Constantine Georgiou