Solved

CPropertyPage refresh THEN do a dialog.domodal()

Posted on 2000-03-19
6
493 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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

705 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now