CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2013
    Posts
    2

    Help with some code

    I need some help with some code I found on freely distributed on the net. Unfortunatly I've lost the website to give credits so if anyone knows it please say and I'll give all credits. Anyway I'm new to programming in general in fact I'm not even 100% sure this is C# code. Either way the code was meant to be complete but when I go to run it I get an exception error. The code is as followed the piece in question that causes the execption is highlighted.


    //Camera Start Stop
    public void initialise_capture()
    {
    grabber = new Capture();
    grabber.QueryFrame();
    //Initialize the FrameGraber event
    if (parrellelToolStripMenuItem.Checked)
    {
    Application.Idle += new EventHandler(FrameGrabber_Parrellel);
    }
    else
    {
    Application.Idle += new EventHandler(FrameGrabber_Standard);
    }
    }
    private void stop_capture()
    {
    if (parrellelToolStripMenuItem.Checked)
    {
    Application.Idle -= new EventHandler(FrameGrabber_Parrellel);
    }
    else
    {
    Application.Idle -= new EventHandler(FrameGrabber_Standard);
    }
    if(grabber!= null)
    {
    grabber.Dispose();
    }
    }

    I believe this is the part where the program attempts to capture the video device inorder for the feed to be shown on screen for the rest of the program to do it's thing. There maybe more errors in the rest of the code but this first one.

    Thanks for your help

    Cable

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Help with some code

    You'll need to figure out where the code was from. If it's from a framegrabber card, you'll need to have the device installed on your computer. Usually mfg that make such cards have SDKs (Software Development Kits) that include code samples to help you.

  3. #3
    Join Date
    Jul 2013
    Posts
    2

    Re: Help with some code

    Quote Originally Posted by Arjay View Post
    You'll need to figure out where the code was from. If it's from a framegrabber card, you'll need to have the device installed on your computer. Usually mfg that make such cards have SDKs (Software Development Kits) that include code samples to help you.

    Thanks for the reply. This is only a segment of the code i do have the whole thing. Its meant to capture any video input device you currently have pluged into your pc and then perform face recognition on it. However when i try to run the code in vb suits 2012 it comes up with the debug error that i hightlighted and im stumped

    Cable

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Help with some code

    What is the error? Is it a compile or runtime error? Also, it's C# code, and you mention vb - you realize that C# code isn't going to run under vb, right?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured