Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 443
  • Last Modified:

A CDialog with a CView in the middle?

I would like to be able to create a dialog type window with a small view window in the middle of it, on which I could display and interact with a bitmap file.

It would have various controls surrounding it, and look something like the Display Properties Screen Saver tab in Win 95.

How would I tackle this using CDialog and CView, or can anyone suggest a better approach?

Thanks.
0
wagtail
Asked:
wagtail
  • 2
1 Solution
 
sapekCommented:
CView classes require CDocument and CFrame so its not good idea to use it in a dialog. You can create an child window of arbitrary window class (your own) in a dialog (it is how custom controls where used in dialogs in the past). The only problem is that its not easy to create a new window class in MFC (MFC gives you the name of the class and in fact it gives you window procedure). You could search for a way to do this in MFC or create the interactive bitmap window class using win32 API (unless you only program in MFC the second is easier I think).Adam
0
 
wagtailAuthor Commented:
Hi Adam,

Thanks for your speedy reply. Could you give a bit more detail to help me understand?

When you talk about  creating my own window class using the Win32 API, do you mean I have to register a WNDCLASS structure with Windows, then create an instance of the window?

If so, is CMyApp::InitInstance() the right place to put this code?

I am confused about how to attach the new window object to the CDialog, so that it becomes a child window of the dialog. Can you explain how to do this?

Thanks very much...
0
 
wagtailAuthor Commented:
I'm disappointed at the silence after my request for clarification, which I felt was reasonable given the 100 points offered... still, you win some and you lose some. In situations like these it would be useful to have the expert's e-mail address to get his/her attention.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now