Re: CAnimateCtrl crashes when going out of scope
Ah, sorry, I missed that. Have you tried freeing up the UI using something
like:
void GiveTime()
{
// Idle until the screen redraws itself, et. al.
MSG msg;
while (::PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE ) ) {
if (!AfxGetThread()->PumpMessage( )) {
::PostQuitMessage(0);
break;
}
}
// let MFC do its idle processing
LONG lIdle = 0;
while (AfxGetApp()->OnIdle(lIdle++ ))
;
}
If you call this function in your "loop" that is eating up the resources it
will free up the UI again. You could also put the cycle hog into a thread.
I'm not sure what the new theme stuff would have to do with it unless it is
also taking some time.
Anyway, I hope I read it right this time... sometimes it's tough to figure
out exactly what is happening.
Tom
"almc" <antonio.carvalho@eloinformatica.pt> wrote in message
news:op.te6y3n06y9hu51@dcspcantonioc.elodecisor.local...
Na , Tom Serface <tserface@msn.com> escreveu:
Why not just make the animation control part of your dialog template and
have it created and destroyed by the framework automatically. You can
hide
it with ShowWindow(). Remember to stop the control before attempting to
destory it.
Hi Tom,
Thanks for your ideia... but as you can read again in the original post,
the control doesn't work when I use it in a slow operation, returning the
result of a recordset, wait for a connection, or what so ever, since I
call the function from a function that only continues after the return of
the call - I hope I was clear in the explanation.
In these kind of uses, as the control doesn't gets the WM_TIMER, then it
doesn't plays the AVI - this only happens if you turn the "XP theme" by
adding the "manifest". Old style application works fine without all this
trouble!!! (Thanks to MS guys!)
And because of all this things I need to create a separate thred where the
AVI plays.
I could also rewrite my code to make the length parts run on threads, but
the trouble would be even worse!!!
ALMC