Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

CPropertyPage refresh THEN do a dialog.domodal()

Posted on 2000-03-19
6
530 Views
Last Modified: 2013-11-20
I have two property pages in a ps, Tab1 and Tab2. I want a dialog to do a .domodal() when tab1 is set active. Logically I put the domodal in the OnSetActive function of Tab1. The problem is when I switch from tab2 to tab1, the .domodal is called and the dialog displays, but the background still shows tab2. I must have tab1 completely refreshed before the dialog does its .domodal. I've tried placing it in several places to no avail. Please help, thanks.
0
Comment
Question by:Dredwick
  • 4
6 Comments
 
LVL 10

Expert Comment

by:RONSLOW
ID: 2634632
Post yourself a user defiend (registered?) message in the OnSetActive.

In the handler for that message, pop up the dialog (DoModal etc).

That way, all the events that need to be processed to made tab1 active and visible will be done before the dialog pops up and gets in the way.
0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 2634646
That was an answer
0
 
LVL 8

Expert Comment

by:VinExpert
ID: 2634649
Hi,

Or, At the end of that function, set the timer using
SetTimer(1, 100, NULL);

Then map the WM_TIMER message to that page, and do the DoModal() there as

....::OnTimer(...)
{
KillTimer(1);
......DoModal();
.....
.....
}

Try it out.

VinExpert
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:Dredwick
ID: 2638557
I've tried the Timer method, and I really thought the PostMessage routine would work, but alas...it didn't. Both run into the same problem. When the routine that is called by the Post returns, it generates an access violation. I've got some theories on this...

I actually came up with the solution on my own. I had to derive a UI Thread class from CWinThread and to an AfxBeginThread(RUNTIME_CLASS(CUIThread));

and that popped up a test message box, and closed without any fuss, which crashed the previous two methods. The other two methods DID work under debug mode, but that is obvious why..

Thanks anyways for the help and suggestions!
0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 2638566
Why is it 'obvious'?
0
 
LVL 10

Accepted Solution

by:
RONSLOW earned 50 total points
ID: 2638597
Sounds like you didn't do the suggested method correctly.

I'd like to see your code please.

Creating a thread is not good .. because the dialog won't be modal .. and threads can be problem.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
sum67 challenge 35 107
wait notify demo infinite loop 3 121
building a service to accessed via telnet client, want colors ? 4 92
Fibonacci challenge 11 132
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question