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

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

tabbed dialog/prop page

I want my main application window to be a tabbed dialog.
I have some this as a property sheet (i.e. main app window is a CPropertySheet descendant), but that is not the look I want for the app - I don't want the OK, Cancel, Apply & Help buttons, and I want a system menu, and a status bar down the bottom.

So instead, I tried to create a MODELESS property sheet inside my main dialog window. I did this from OnInitDialog, with the property sheet as a member of the main dialog class, as in

CMainDlg::OnInitDialog() {
  ...
  m_propSheet.Create(this, WS_CHILD|WS_VISIBLE);
  ...
}

Now this seems to work some of the time, but very often, the application suddenly goes into a tailspin, and starts hard looping. I use Debug/Break to see what it is doing, and it it just appears to be in the Message Loop (although I can't really tell whose).

Am I doing anything wrong?
Is there a better way?

Thanks,

DW
0
davidoz
Asked:
davidoz
  • 2
  • 2
1 Solution
 
RONSLOWCommented:
Turn on message tracing to help determine what message are happening.

Also what sort of action triggers this problem (changing tabs?, pressing a button?)  What does the app look like when this happens - is it painting ok?  If you put another app window over the top of it and then remove it, does your app paint ok?
0
 
davidozAuthor Commented:
How to turn on message tracing (VC++5), and for which messages? And then what do I look for?
I'm not sure what causes it: I think it happens when i move the focus to a different app, but also at other times.
Once it does happen, the app does not respond, and does not repaint - the CPU meter goes to 100%
0
 
RONSLOWCommented:
Tools menu - MFC Tracer - turn on the options you want.

Also, add suitable TRACE statements to parts of your code that generate or respond to messages and command so you can see better what is happening.

0
 
kargoCommented:
There is a known bug when using the property sheet control as a modeless dialog.  There is a fix in the MS KB that describes handling a message.  The KB article is Q149501.
0
 
davidozAuthor Commented:
This is what experts exchange is all about! Thank you!!!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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