Results 1 to 3 of 3

Thread: how to solve System.AccessViolationException???

  1. #1
    New Member
    Join Date
    Aug 12
    Posts
    3

    Post how to solve System.AccessViolationException???

    Hey I am capturing images using my webcam application.
    But when I am grabbing those images by using
    bmp.bmpN->Save(String::Concat(cnt.ToString().".bmp"));

    I am getting Syste.AccessViolationExcetion.
    Its not able to grab the images..
    anyone knows how to solve it...

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 05
    Location
    Sweden
    Posts
    8,013

    Re: how to solve System.AccessViolationException???

    What type the 'bmp' object? Aren't you receiving any other message along with the exception?
    ---My Flickr photo (mostly screenshots these days!) stream. Have a look!

    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    TCP client/server connection | Retrieving the EventHandler for any Event by code.
    Check out the work in progress: Vortex - C++ 3D Game engine for windows and linux - (Development blog - Leave a comment!)

  3. #3
    New Member
    Join Date
    Aug 12
    Posts
    3

    Re: how to solve System.AccessViolationException???

    ************** Exception Text **************
    System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    at System.Drawing.SafeNativeMethods.Gdip.GdipSaveImageToFile(HandleRef image, String filename, Guid& classId, HandleRef encoderParams)
    at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams)
    at System.Drawing.Image.Save(String filename, ImageFormat format)
    at System.Drawing.Image.Save(String filename)
    at CPP_DS_CapSample.Form1.Grab_Click(Object sender, EventArgs e) in c:\users\admin\downloads\article_src\article_src\cpp_ds_capsample\form1.h:line 260
    at System.Windows.Forms.Control.OnClick(EventArgs e)
    at System.Windows.Forms.Button.OnClick(EventArgs e)
    at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
    at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.ButtonBase.WndProc(Message& m)
    at System.Windows.Forms.Button.WndProc(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


    ************** Loaded Assemblies **************
    mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5456 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    ----------------------------------------
    CPP_DS_CapSample
    Assembly Version: 1.0.4603.21417
    Win32 Version:
    CodeBase: file:///C:/Users/Infoshore/Desktop/jayant/Article_src/Article_src/Debug/CPP_DS_CapSample.exe
    ----------------------------------------
    msvcm90d
    Assembly Version: 9.0.30729.6161
    Win32 Version: 9.00.30729.6161
    CodeBase: file:///C:/Windows/WinSxS/x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_2a4f639a55563668/msvcm90d.dll
    ----------------------------------------
    System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5456 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5460 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5462 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    System.Configuration
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    ----------------------------------------
    System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
    ----------------------------------------

    ************** JIT Debugging **************
    To enable just-in-time (JIT) debugging, the .config file for this
    application or computer (machine.config) must have the
    jitDebugging value set in the system.windows.forms section.
    The application must also be compiled with debugging
    enabled.

Posting Permissions

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