Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Handling access violations in a .NET program - generated by native code

Handling access violations in a .NET program - generated by native code

Scheduled Pinned Locked Moved C#
csharpc++helpquestiondatabase
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dabs
    wrote on last edited by
    #1

    Hi all, I have an application written in C#, and it is using P/Invoke to access functions defined in a custom (open source) dll, written in C++. My app is running as a service at client site, and occasionally it has failed, leaving an entry in the System Event Log, and the log message hasn't been terribly helpful. Basically it has said that an error occurred in this particular module (the native C++ one), but nothing more than that. I have the full source code for this module, and I believe all compiler settings are correctly set in the release build configuration (Generate Debug Info, Program Database etc.). What is my best shot at getting as much information about the crash when it occurs? Obviously, I'm handling all managed exceptions in my own code. Any help whatsoever would be great. Regards, Daníel


    Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!

    L 1 Reply Last reply
    0
    • D dabs

      Hi all, I have an application written in C#, and it is using P/Invoke to access functions defined in a custom (open source) dll, written in C++. My app is running as a service at client site, and occasionally it has failed, leaving an entry in the System Event Log, and the log message hasn't been terribly helpful. Basically it has said that an error occurred in this particular module (the native C++ one), but nothing more than that. I have the full source code for this module, and I believe all compiler settings are correctly set in the release build configuration (Generate Debug Info, Program Database etc.). What is my best shot at getting as much information about the crash when it occurs? Obviously, I'm handling all managed exceptions in my own code. Any help whatsoever would be great. Regards, Daníel


      Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      You should be able to create a C++ / CLI mixed mode assembly that catches the native exception and then throws a managed exception back up to the C# code.

      led mike

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups