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 / C++ / MFC
  4. Not a C++ coder needing C++ help

Not a C++ coder needing C++ help

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
4 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.
  • L Offline
    L Offline
    LongRange Shooter
    wrote on last edited by
    #1

    I need to put together a sample project that does one simple(?) task in C++ Inherit System.Exception override Message return my own Message What I have so far...help is greatly appreciated. // TestCPlus.h #pragma once using namespace System; using namespace System::Diagnostics; namespace TestCPlus { class MyException : public System::Exception { public: int rCode; char* blah; // probably wrong type definition for string char* Message : System::Exception::Message { return blah; }; }; } There are 10 kinds of people in the world.
    Those that read binary...
    ...and those who don't.

    S 1 Reply Last reply
    0
    • L LongRange Shooter

      I need to put together a sample project that does one simple(?) task in C++ Inherit System.Exception override Message return my own Message What I have so far...help is greatly appreciated. // TestCPlus.h #pragma once using namespace System; using namespace System::Diagnostics; namespace TestCPlus { class MyException : public System::Exception { public: int rCode; char* blah; // probably wrong type definition for string char* Message : System::Exception::Message { return blah; }; }; } There are 10 kinds of people in the world.
      Those that read binary...
      ...and those who don't.

      S Offline
      S Offline
      Serge Krynine
      wrote on last edited by
      #2

      Hope this will help, Serge #include "stdafx.h" #using using namespace System; __gc class MyException : public System::Exception { public: __property virtual String* get_Message() {return "Hello, World!";} }; int main() { try { throw new MyException; } catch (MyException *e) { Console::WriteLine(e->Message); } return 0; }

      L 1 Reply Last reply
      0
      • S Serge Krynine

        Hope this will help, Serge #include "stdafx.h" #using using namespace System; __gc class MyException : public System::Exception { public: __property virtual String* get_Message() {return "Hello, World!";} }; int main() { try { throw new MyException; } catch (MyException *e) { Console::WriteLine(e->Message); } return 0; }

        L Offline
        L Offline
        LongRange Shooter
        wrote on last edited by
        #3

        Serge, Thank you very much. So here is the big question: Is there a way in C++ to append comments to methods and properties as there is in C#. I know that C++.net does not recognize the triple-slash, but I also saw something about Output Browser Information and was wondering if that was the mechanism for exposing method comments???!! Michael There are 10 kinds of people in the world.
        Those that read binary...
        ...and those who don't.

        S 1 Reply Last reply
        0
        • L LongRange Shooter

          Serge, Thank you very much. So here is the big question: Is there a way in C++ to append comments to methods and properties as there is in C#. I know that C++.net does not recognize the triple-slash, but I also saw something about Output Browser Information and was wondering if that was the mechanism for exposing method comments???!! Michael There are 10 kinds of people in the world.
          Those that read binary...
          ...and those who don't.

          S Offline
          S Offline
          Serge Krynine
          wrote on last edited by
          #4

          Michael, MSDN states that “Visual C++ provides limited support for XML documentation comments”. I do not know what they mean by that (what is supported and what is not), but as per the .NET 2003, even if I want to attach a simple summary to a class, like this: /// /// This is my Visual C++ class /// class MyClass { }; Visual C++ would generate an empty Comment Web Page (via the “Tools | Build Comment Web Pages…” option). And the Visual C++ compiler does not support the /doc compiler option as the C# compiler does. May be other people have something to say on this? Serge

          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