Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

CPropertyPage refresh THEN do a dialog.domodal()

Posted on 2000-03-19
6
Medium Priority
?
583 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
[X]
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
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 150 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

610 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