title: How to write user defined exceptions in Visual C++ unmanaged code?
body: <p>I would like to know how to write unmanaged exceptions in Visual C++?</p>
  
  <pre><code>#include &lt;string&gt;
  #include &lt;exception&gt;
  
  using namespace std;
  using namespace System;
  
  class GraphException : public Exception
  {
  public:
      GraphException() { }
  //  GraphException(string message) : Exception (message)
  //  { }
  //  GraphException(string message, Exception inner) : Exception (message, inner)
  //  { }
  };
  </code></pre>
  
  <p>this does not work i get the following error,</p>
  
  <blockquote>
    <p>Error 1   error C3625: 'GraphException': an unmanaged type cannot derive
    from a managed type
    'System::Exception'   c:\breadthfirst\graph\graphexception.h  10  1   breadthFirst</p>
  </blockquote>
  
  <p>Can someone please help me?</p>