I'm designing my app by using of MFC, I'm not quite familiar with MFC framework, my background is some Win32 and WinForms experience. Right here I got some designing issue, and I'm trying to get help from you guys, first here's how my app would look like,
1. Basically, there will be a main window, with some dynamically created sub-windows inside, which may have some nested, also dynamically created, child controls over there, too. Some of controls would be straight CWnd-derived, since I have to draw them by myself in most cases.
2. Sub windows are independent with each other, that is, they conform to standard window behavior, they accept input messages, they have z-orders, they have titlebars (in my test, creating a CWnd with/without WS_CAPTION got different behavior regarding to focus/input message).

At the beginning, I created a CDialog-based app, however, it worked wierd. The focus, the z-order, the painting, all of them got problems. I still can't fix it.

So, I'm rethinking if a CDialog-based app works for my use case. Frankly, I've never seen a dialog-based app contained windows. The reason why I didn't pick up MDI was that I'm totally new to it. I knew little about doc/view, and I did't think concept "doc" was good for my case, I might only need the "view". And people always said MDI got things more complicated.

Secondly, I'm also doubted that building my controls depends on CWnd. I thought it would be simple, when I need to draw then I draw it in OnPaint, when I need to respond specially then I handle messages in WndProc, world should be simple enough. But it doesn't look so simple now. WinForm get its base control type - UserControl, not does MFC.
I found that messages routing didn't work exactly as expected, so I sit back and rethink about if my orginal design is right.

What should be basic structure of my case?

Welcome any suggestion.