Solved

CPropertyPage refresh THEN do a dialog.domodal()

Posted on 2000-03-19
6
518 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Login Script to Copy Folders 12 34
Shell script to login to remote m/c and execute commands 10 78
pre4 challenge 19 99
withoutTen challenge 14 119
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 tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

813 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

10 Experts available now in Live!

Get 1:1 Help Now