Click here to Skip to main content
15,915,702 members
Home / Discussions / C#
   

C#

 
AnswerRe: Can i use web space in C# project? Pin
DaveyM6915-May-09 9:59
professionalDaveyM6915-May-09 9:59 
AnswerRe: Can i use web space in C# project? Pin
EliottA15-May-09 11:46
EliottA15-May-09 11:46 
GeneralRe: Can i use web space in C# project? Pin
abhishek2926-May-09 9:08
abhishek2926-May-09 9:08 
GeneralRe: Can i use web space in C# project? Pin
EliottA26-May-09 9:20
EliottA26-May-09 9:20 
GeneralRe: Can i use web space in C# project? Pin
abhishek2926-May-09 17:55
abhishek2926-May-09 17:55 
QuestionMDI parent form maximize problem Pin
atifamin200215-May-09 9:15
atifamin200215-May-09 9:15 
AnswerRe: MDI parent form maximize problem Pin
DaveyM6915-May-09 9:44
professionalDaveyM6915-May-09 9:44 
QuestionBackground worker Pin
Payam Rastogi15-May-09 6:54
Payam Rastogi15-May-09 6:54 
Hi,
I'm using C#.net 3.0. I have use the frameGrabber class to grab the frames from the video file and to convert the frames into bitmap format.The code is giving error in the "foreach (FrameGrabber.Frame f in fg)line of the code" highlighting "in" giving error---"InvalidCastException was unhandled by user"(Unable to cast COM object of type'DirectShowLib.DES.MediaDet' to interface type 'DirectShowLib.DES.IMediaDet'.This operation failed because the QueryInterface call on the COM component for the interface with IID '{65BD0710-24D2-4FF7-9324-ED2E5D3ABAFA}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).).I use this background worker so that I can stop the extraction of frame in middle of execution,but if i don't use this Background worker the code is running properly.

[code]
        private void button43_Click(object sender, EventArgs e)//Extract Button
        {
            backgroundWorker1.RunWorkerAsync();
        }

        private void button44_Click(object sender, EventArgs e)//Stop Button
        {
            backgroundWorker1.CancelAsync();
        }

        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            string outPath = txtExtBitmap.Text;
            System.IO.Directory.CreateDirectory(outPath);

            if (fg != null)
            {
                foreach (FrameGrabber.Frame f in fg)//error in this line highlighting "in"
                {
                    using (f)
                    {
                        picBoxFrame.Image = (Bitmap)f.Image.Clone();
                        f.Image.Save(System.IO.Path.Combine(outPath, "frame" + f.FrameIndex + ".bmp"), System.Drawing.Imaging.ImageFormat.Bmp);
                        //Application.DoEvents();
                    }

                    if (fg == null)
                    {
                        return;
                    }
                }
            }
            if (backgroundWorker1.CancellationPending)
            {
                e.Cancel = true;
                return;
            }
        }

        private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (e.Cancelled)
            {
                MessageBox.Show("Operation Cancelled");
            }
            else
            {
                MessageBox.Show("OperationCompleted");
            }
        }

[\code]

AnswerRe: Background worker Pin
DaveyM6915-May-09 9:50
professionalDaveyM6915-May-09 9:50 
GeneralRe: Background worker Pin
Payam Rastogi15-May-09 9:57
Payam Rastogi15-May-09 9:57 
GeneralRe: Background worker Pin
DaveyM6915-May-09 10:10
professionalDaveyM6915-May-09 10:10 
QuestionHow to prevent RowState change if Cell is not changed Pin
EURaklap15-May-09 6:19
EURaklap15-May-09 6:19 
QuestionMultiple forms and datagridviews Pin
bwood202015-May-09 6:02
bwood202015-May-09 6:02 
AnswerRe: Multiple forms and datagridviews Pin
Henry Minute15-May-09 10:05
Henry Minute15-May-09 10:05 
GeneralRe: Multiple forms and datagridviews Pin
bwood202015-May-09 10:09
bwood202015-May-09 10:09 
GeneralRe: Multiple forms and datagridviews Pin
Henry Minute15-May-09 10:33
Henry Minute15-May-09 10:33 
GeneralRe: Multiple forms and datagridviews Pin
bwood202015-May-09 12:17
bwood202015-May-09 12:17 
GeneralRe: Multiple forms and datagridviews Pin
Henry Minute15-May-09 13:09
Henry Minute15-May-09 13:09 
GeneralRe: Multiple forms and datagridviews [modified] Pin
bwood202018-May-09 6:50
bwood202018-May-09 6:50 
GeneralRe: Multiple forms and datagridviews Pin
Henry Minute18-May-09 8:18
Henry Minute18-May-09 8:18 
GeneralRe: Multiple forms and datagridviews Pin
bwood202018-May-09 8:44
bwood202018-May-09 8:44 
GeneralRe: Multiple forms and datagridviews Pin
Henry Minute18-May-09 9:54
Henry Minute18-May-09 9:54 
GeneralRe: Multiple forms and datagridviews Pin
bwood202018-May-09 12:54
bwood202018-May-09 12:54 
GeneralRe: Multiple forms and datagridviews Pin
Henry Minute18-May-09 13:01
Henry Minute18-May-09 13:01 
GeneralRe: Multiple forms and datagridviews Pin
bwood202019-May-09 7:13
bwood202019-May-09 7:13 

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.