Click here to Skip to main content
15,878,814 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This is my code;


C#
CleanUp();

           m_objFilterGraph = new FilgraphManager();
           string strFileName = DBUtils.ImagePath + "\\" + strFolderName + "\\" + txtFileID.Text.Trim() + ".AVI";
           if (File.Exists(strFileName))
           {
               m_objFilterGraph.RenderFile(strFileName);-Error come this line

               m_objBasicAudio = m_objFilterGraph as IBasicAudio;

               try
               {
                   m_objVideoWindow = m_objFilterGraph as IVideoWindow;
                   m_objVideoWindow.Owner = (int)panel2.Handle;
                   m_objVideoWindow.WindowStyle = WS_CHILD | WS_CLIPCHILDREN;
                   m_objVideoWindow.SetWindowPosition(panel2.ClientRectangle.Left,
                       panel2.ClientRectangle.Top,
                       panel2.ClientRectangle.Width,
                       panel2.ClientRectangle.Height);
               }
               catch (Exception)
               {
                   m_objVideoWindow = null;
               }

               m_objMediaEvent = m_objFilterGraph as IMediaEvent;

               m_objMediaEventEx = m_objFilterGraph as IMediaEventEx;
               m_objMediaEventEx.SetNotifyWindow((int)this.Handle, WM_GRAPHNOTIFY, 0);

               m_objMediaPosition = m_objFilterGraph as IMediaPosition;

               m_objMediaControl = m_objFilterGraph as IMediaControl;


               m_objMediaControl.Run();
               tabCtrlImage.SelectedTab = tbVideo;
               tbVideo.Focus();
           }
           else
               return;

       }





i press the video play button that time one error is came.. COM Exception was unhandled Exception from HRESULT 0x80040255..HOW TO SOLVE THIS ERROR
Posted
Comments
Sandeep Mewara 27-Jan-13 1:30am    
It would be good to share exact error.
[no name] 27-Jan-13 5:36am    
you might be missing the exact dll that is required in the using section.

it looks like your COM component is not installed properly and It is not able to create an Object of FilgraphManager on second line. Better debug there and see if you are getting some object of FilgraphManager.
 
Share this answer
 
Can you try out by uninstalling and installing back the Direct-X. It looks like a a Direct-X crash.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900