【发布时间】:2012-05-24 08:09:31
【问题描述】:
我想知道如何在 Visual C++ 中编写非托管异常?
#include <string>
#include <exception>
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)
// { }
};
这不起作用,我收到以下错误,
错误 1 错误 C3625:“GraphException”:无法派生非托管类型 从托管类型 'System::Exception' c:\breadthfirst\graph\graphexception.h 10 1 广度优先
有人可以帮帮我吗?
【问题讨论】:
标签: c++ visual-c++ exception exception-handling unmanaged