From: Sonu on
Ok, I added the _T() abound the Characters in .ReverseFind( '\\' ) );

But that is not the problem... The problem I am having is that the Amimation
does not run...
I see a stationary hourglass. But it does not move.... If the user refreshes
the window, the stationary hourglass disappears and the ctrl that is about to
get populated with the search results from the background process kindof
becomes blank.. which leads the user to fear that the program has crashed,
which is not the case... it's just that the animation is not working.
Please note that this same code used to work when compiled in the older
versions of VS.

Thanks
Srishti



"Joseph M. Newcomer" wrote:

> See below...
> On Mon, 3 Mar 2008 13:13:02 -0800, Sonu <sonu(a)online.nospam> wrote:
>
> >Here is the code for mod_dir and no, I don't think that is the problem!
> >
> > extern CString mod_dir;
> > TCHAR file[_MAX_PATH];
> > GetModuleFileName( NULL, file, _MAX_PATH );
> > mod_dir = file;
> > mod_dir = mod_dir.Mid( 0, mod_dir.ReverseFind( '\\' ) );
> ****
> Seems a bit odd; why not
> int n = mod_dir.ReverseFind(_T('\\'));
> if(n < 0)
> ... deal with lack of any path
> else
> mod_dir = mod_dir.Left(n + 1);
> Note that if you are using _T() as below, you must ALSO use _T() around the character
> constants! But presuming that the value will be non-negative is dangerous. Also, you
> should assume that _T('/') is a valid path delimiter. Better still, use _tsplitpath and
> _tmakepath (or in VS2005, _tsplitpath_s and _tmakepath_s).
> joe
> ****
> >#if _DEBUG
> > mod_dir = mod_dir.Mid( 0, mod_dir.ReverseFind( '\\' ) );
> > mod_dir += _T("\\Release");
> >#endif
> >
> >
> >"AliR (VC++ MVP)" wrote:
> >
> >> What's in mod_dir make sure that you are not adding too many \ to the path.
> >> If mod_dir ends with \\ and you add \\ then you will endup with an invalid
> >> path.
> >>
> >>
> >> AliR.
> >>
> >> "Sonu" <sonu(a)online.nospam> wrote in message
> >> news:D70DB990-0486-4346-807E-171BFC24EF93(a)microsoft.com...
> >> > Hello all...
> >> > I have an animate ctrl in a dialog box, which plays the simple
> >> > document_search.avi fileof the magnifying glass moving around while I am
> >> > doing a task in the background.
> >> > This code used to work when I had my project in VC6.0 and maybe also in
> >> > VS2003 but when I moved it in VS2005 (or was it already in 2003) the
> >> > animation doesn't work.
> >> > So the users think that the program is crashing now as it's kinda frozen
> >> > and
> >> > no animation to console them!
> >> > At the beg of the task:
> >> > m_search_animate.ShowWindow(SW_SHOW);
> >> > extern CString mod_dir;
> >> > m_search_animate.Open( mod_dir + _T("\\document search.avi") );
> >> > m_search_animate.Play( 0, -1, -1 );
> >> >
> >> > at the end of the task:
> >> >
> >> > m_search_animate.Stop();
> >> > m_search_animate.Close();
> >> > m_search_animate.EnableWindow(FALSE);
> >> > m_search_animate.ShowWindow(SW_HIDE);
> >> >
> >> > Also, the parameters of the Play() are UINTs. So when I give -1 for the
> >> > parameters for continuous play as described int he MSDN, I get
> >> > warnings...While I am not very fond of!
> >> > Please help
> >> > Thanks
> >> > Srishti
> >> >
> >>
> >>
> >>
> Joseph M. Newcomer [MVP]
> email: newcomer(a)flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm
>
From: Jeff Partch on
My guess is its the difference between the V5 and V6 (XP, common control
manifest) implementation of the control. A behavior change is documented
here...

http://msdn.microsoft.com/library/en-us/shellcc/platform/commctls/animation/styles.asp *

....In earlier versions, "By default, the control creates a thread to play
the AVI clip", whereas in the V6 version, "By default, the control plays the
AVI clip without creating a thread". Which I suspect means that, "If ... the
control plays the clip without creating a thread; internally the control
uses a Win32 timer to synchronize playback", and which I think means that
you need to return to the message loop so that WM_TIMER message are
processed. Are you by any chance running a loop that precludes this?

--
Jeff Partch

* That's the current URL, but the online library seems to be broken
presently.


From: Sonu on
Uhh.... Not sure if I understand that all the way... No It is not in a
loop... if that's what you meant? But there are loops after starting the Play
and before the Stop!

Does thta make any sense?
Thanks a lot
Srishti



"Jeff Partch" wrote:

> My guess is its the difference between the V5 and V6 (XP, common control
> manifest) implementation of the control. A behavior change is documented
> here...
>
> http://msdn.microsoft.com/library/en-us/shellcc/platform/commctls/animation/styles.asp *
>
> ....In earlier versions, "By default, the control creates a thread to play
> the AVI clip", whereas in the V6 version, "By default, the control plays the
> AVI clip without creating a thread". Which I suspect means that, "If ... the
> control plays the clip without creating a thread; internally the control
> uses a Win32 timer to synchronize playback", and which I think means that
> you need to return to the message loop so that WM_TIMER message are
> processed. Are you by any chance running a loop that precludes this?
>
> --
> Jeff Partch
>
> * That's the current URL, but the online library seems to be broken
> presently.
>
>
>
From: Charles Wang[MSFT] on
Hi Srishti,
I performed a test on this sample project:
http://www.codejock.com/support/articles/mfc/general/g_3.asp

After I upgraded the project to Visual C++ 8.0, everything still worked
fine. You may download the project for comparing it with yours.

If it does not help, could you reproduce your issue in a test project? If
so, is it possible for you to mail me (changliw_at_microsoft_dot_com) a
sample project for further research?

Best regards,
Charles Wang
Microsoft Online Community Support
=====================================================
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
======================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================






From: Giovanni Dicanio on

"Charles Wang[MSFT]" <changliw(a)online.microsoft.com> ha scritto nel
messaggio news:ueDW5JdfIHA.6844(a)TK2MSFTNGHUB02.phx.gbl...

> I performed a test on this sample project:
> http://www.codejock.com/support/articles/mfc/general/g_3.asp
>
> After I upgraded the project to Visual C++ 8.0, everything still worked
> fine.

I confirm that: I've tried that, too.

However, the aforementioned sample loads the AVI from resource, instead OP's
code loads the AVI from an external file (if my understanding is correct).

I would suggest the OP to check the *return value* of AVI control
CAnimateCtrl::Open method for success.
It may be that the control fails the loading of external AVI file?

And what happens if the OP's AVI file is embedded as a resource, like sample
pointed by Charles?

Giovanni