Animation Control in MFC
-
Hi, I want to show the progress bar as animation. Can any one give me an example to show how to use CAnimationCtrl Thanks
-
Hi, I want to show the progress bar as animation. Can any one give me an example to show how to use CAnimationCtrl Thanks
this is the easiest control ever use, just add an animate control on a dialog box, add a variable of type CAnimateCtrl. in the OnInitDialog() function call the function Open() and Play(). remember to call function Close() in ua dlg box's OnClose() function or onDestroy() like this. ////////////////////////// m_ctlMyAnimation.Open(_T("C:\\Windows\System32\\migwiz\\progress.avi")); m_ctlMyAnimation.Play(); //////////////////////// remember that this avi shud be some of those simple animation files, not music video or moviz, a good example is that microsoft dog that shows up when yu are searching. ::OnButtonStop() { m_ctlMyAnimation.Stop(); } ::OnClose() { m_ctlMyAnimation.Close(); }
-
Hi, I want to show the progress bar as animation. Can any one give me an example to show how to use CAnimationCtrl Thanks
-
this is the easiest control ever use, just add an animate control on a dialog box, add a variable of type CAnimateCtrl. in the OnInitDialog() function call the function Open() and Play(). remember to call function Close() in ua dlg box's OnClose() function or onDestroy() like this. ////////////////////////// m_ctlMyAnimation.Open(_T("C:\\Windows\System32\\migwiz\\progress.avi")); m_ctlMyAnimation.Play(); //////////////////////// remember that this avi shud be some of those simple animation files, not music video or moviz, a good example is that microsoft dog that shows up when yu are searching. ::OnButtonStop() { m_ctlMyAnimation.Stop(); } ::OnClose() { m_ctlMyAnimation.Close(); }
Hi, I have used the following code m_avi.Open(IDR_AVI1); m_avi.Play(0,-1,-1); but its giving debug assert at open function whats the problem
-
Hi, I have used the following code m_avi.Open(IDR_AVI1); m_avi.Play(0,-1,-1); but its giving debug assert at open function whats the problem
Dhiraj kumar Saini wrote:
whats the problem
Find out for yourself what the problem is - use the debugger to find out what assert is being called. Alternatively, put a break point in your code and use the Step Into debug option to follow through the MFC code. Have you tried having the avi as a file, and using Open ("myfile.avi")? Does that work? I suspect you'll either not have the avi properly embedded as a resource, or IDR_AVI1 means different things in different places (it is only defined in resource.h?), or maybe as the wrong resource type. Good luck, Iain.
-
Hi, I have used the following code m_avi.Open(IDR_AVI1); m_avi.Play(0,-1,-1); but its giving debug assert at open function whats the problem
how/where is IDR_AVI1 defined? Does it contain a valid path for the AVI File
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
-
how/where is IDR_AVI1 defined? Does it contain a valid path for the AVI File
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
The problem is resolved but now i am having a new problem I having a CMainDlg class for Parent dialog on which i am painting CVisitorDlg as a child dialog. I have used CAnimateCtrl in CMainDlg which I want to show when a user clicks a button on CMainDlg. But during clicking this button the CVisitorDlg dialog (Child Dialog is being repainted as it is fetching data from server. But the CAnimateCtrl is showing the animated images after the child dialog is repainted and not during fetching the data. Please tell what to do.
-
The problem is resolved but now i am having a new problem I having a CMainDlg class for Parent dialog on which i am painting CVisitorDlg as a child dialog. I have used CAnimateCtrl in CMainDlg which I want to show when a user clicks a button on CMainDlg. But during clicking this button the CVisitorDlg dialog (Child Dialog is being repainted as it is fetching data from server. But the CAnimateCtrl is showing the animated images after the child dialog is repainted and not during fetching the data. Please tell what to do.
Dhiraj kumar Saini wrote:
Please tell what to do.
1/ Go on, tell us the solution! I'd like to know if one of my 4 guesses was right. 2/ If it is a new problem, then post a new question - you'll get more people reading it. Iain.
-
The problem is resolved but now i am having a new problem I having a CMainDlg class for Parent dialog on which i am painting CVisitorDlg as a child dialog. I have used CAnimateCtrl in CMainDlg which I want to show when a user clicks a button on CMainDlg. But during clicking this button the CVisitorDlg dialog (Child Dialog is being repainted as it is fetching data from server. But the CAnimateCtrl is showing the animated images after the child dialog is repainted and not during fetching the data. Please tell what to do.
And the reason for the problem getting resolved was....?
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
-
The problem is resolved but now i am having a new problem I having a CMainDlg class for Parent dialog on which i am painting CVisitorDlg as a child dialog. I have used CAnimateCtrl in CMainDlg which I want to show when a user clicks a button on CMainDlg. But during clicking this button the CVisitorDlg dialog (Child Dialog is being repainted as it is fetching data from server. But the CAnimateCtrl is showing the animated images after the child dialog is repainted and not during fetching the data. Please tell what to do.
are you doing all this in your main thread, then in this case it would get blocked in the process of receiving the data from the server. you should create another thread and implement some notification method to inform the UI that the data download is completed.
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
-
are you doing all this in your main thread, then in this case it would get blocked in the process of receiving the data from the server. you should create another thread and implement some notification method to inform the UI that the data download is completed.
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
Yes I am doing it in the main thread. Can u tell how to make a new thread so that it works fine
-
And the reason for the problem getting resolved was....?
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
Actually the avi file was corrupt
-
Yes I am doing it in the main thread. Can u tell how to make a new thread so that it works fine
Here[^] is an excellent article that I suggest you read. Threads can't be explained in three lines, this is a very deep subject.
Cédric Moonen Software developer
Charting control [v1.5] OpenGL game tutorial in C++