Click here to Skip to main content
16,011,815 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Modeless dialogs can be reached even if there's one that is modal Pin
Michael Dunn13-Dec-00 19:28
sitebuilderMichael Dunn13-Dec-00 19:28 
GeneralBackground image problem Pin
13-Dec-00 11:18
suss13-Dec-00 11:18 
GeneralRe: Background image problem Pin
13-Dec-00 16:27
suss13-Dec-00 16:27 
GeneralUnusal Visual C++ behavior please help Pin
13-Dec-00 7:20
suss13-Dec-00 7:20 
GeneralRe: Unusal Visual C++ behavior please help Pin
Michael Dunn13-Dec-00 8:00
sitebuilderMichael Dunn13-Dec-00 8:00 
GeneralRe: Unusal Visual C++ behavior please help Pin
Ron Russell13-Dec-00 8:15
Ron Russell13-Dec-00 8:15 
GeneralRe: Unusal Visual C++ behavior please help Pin
13-Dec-00 9:41
suss13-Dec-00 9:41 
GeneralRe: Unusal Visual C++ behavior please help Pin
Ron Russell13-Dec-00 9:53
Ron Russell13-Dec-00 9:53 
Note that the assertion is getting thrown because ::IsWindow() is failing in the CProgressControl::SetPos(..) member.

This tells you for sure that the progress control has certainly not been created the first time this function has been called.

Try the following:

Replace:

m_progress.SetPos(speed);

With:

if (::IsWindow(m_progress.GetSafeHwnd()))
{
m_progress.SetPos(speed);
}


Replace:

m_slider.SetPos(speed);

With:

if (::IsWindow(m_slider.GetSafeHwnd()))
{
m_slider.SetPos(speed);
}

With these modifications, you should not have to alter you architecture too much, and it should work as soon as the controls are created.

The code is being called before within the context of the dynamic data exchange function (i.e. your dialog's DoDataExchange(CDataExchange* pDX)). The first time this function is called, the controls have not yet been created, so the modifications I have suggested to not hurt you. Once the controls have been created and you can intereact with them, then the ::IsWindow() function will succeed for each and you should get the desired effect.

Ronald L. Russell Jr. (Ron)
rrussell@ygrest.com

GeneralHiding an application from the Tasklist Pin
Ron Russell13-Dec-00 6:14
Ron Russell13-Dec-00 6:14 
GeneralRe: Hiding an application from the Tasklist Pin
13-Dec-00 6:59
suss13-Dec-00 6:59 
GeneralRe: Hiding an application from the Tasklist Pin
Ron Russell13-Dec-00 7:42
Ron Russell13-Dec-00 7:42 
GeneralBackground Image on CListCtrl Pin
Kannan Kalyanaraman12-Dec-00 23:52
Kannan Kalyanaraman12-Dec-00 23:52 
QuestionUpdating Resources under Windows 98/Me???? Pin
12-Dec-00 22:11
suss12-Dec-00 22:11 
QuestionHow to create a window without title bar? Pin
Satervalley12-Dec-00 22:02
Satervalley12-Dec-00 22:02 
AnswerRe: How to create a window without title bar? Pin
Tim Deveaux14-Dec-00 13:27
Tim Deveaux14-Dec-00 13:27 
Questionhow do i make a dialog hidden *before* it gets shown? Pin
12-Dec-00 12:27
suss12-Dec-00 12:27 
AnswerRe: how do i make a dialog hidden *before* it gets shown? Pin
Erik Funkenbusch12-Dec-00 13:25
Erik Funkenbusch12-Dec-00 13:25 
GeneralPortable Encryption API Pin
Alvaro Mendez12-Dec-00 8:15
Alvaro Mendez12-Dec-00 8:15 
GeneralRe: Portable Encryption API Pin
13-Dec-00 7:09
suss13-Dec-00 7:09 
GeneralCalculating Time Pin
12-Dec-00 5:27
suss12-Dec-00 5:27 
GeneralAVIs for CAnimateCtrl Pin
Luis Barreira12-Dec-00 4:00
Luis Barreira12-Dec-00 4:00 
QuestionHow to display elapsing time Pin
leonwoo12-Dec-00 3:52
leonwoo12-Dec-00 3:52 
AnswerRe: How to display elapsing time Pin
NormDroid12-Dec-00 4:50
professionalNormDroid12-Dec-00 4:50 
GeneralCheckboxes in a CListCtrl Pin
12-Dec-00 3:45
suss12-Dec-00 3:45 
GeneralShell hooks in the absence of Explorer.exe Pin
Ron Russell12-Dec-00 3:37
Ron Russell12-Dec-00 3:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.