virtual PostExecAction Execute() throw(exception) = 0;
generates the following
error C3646: 'exception' : unknown override specifier.
What is the proper format for the declaration in VS2008 C++?
--
Thanks
Morris
The format looks correct, but for some reason "exception" is unknown.
If you change it temporarily to int see if that eliminates that
particular error.
Dave
The compiler cannot find the declaration of the class 'exception', thus it
generates the error C3646: 'exception' : unknown override specifier.
According to the MSDN article
http://msdn.microsoft.com/en-us/library/c4ts6d5a.aspx, using the
'exception' class requires the header file <exception> and the namespace
std. Please check whether you have these two things in the file.
#include <exception>
using namespace std;
The code compiled well in VC6.0. The problem might be caused by the process
of upgrade. Please check whether or not VS2008 generated any error reports
in the upgrade wizard. Comparing the source code before and after the
upgrade may also help us figure out why the two requirements of 'exception'
are lost.
Regards,
Jialiang Ge (jia...@online.microsoft.com, remove 'online.')
Microsoft Online Community Support
=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msd...@microsoft.com.
This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
It seems that you have made managed (.NET CLR) C++ project in VC++
2008 as opposite to native C++ project. The error C3646 relates to
CLR features.
However, putting the CLR issue aside, I'd suggest you to drop
exception specifications altogether. VC++ doesn't support
exception specifications except for one special case: throw(),
i.e. empty exception specification. For more info about exception
specifications read here:
"A Pragmatic Look at Exception Specifications"
http://www.gotw.ca/publications/mill22.htm
HTH
Alex
Is keeping the project in native c++ the easiest way to move my project to
vs2008 from vs6.0?
Or is the managed code the way to go?
--
Thanks
Morris
I don't have VC++6.0 at hand to check it, but I douth that VS2008
automatically converts old VC++6.0 projects to managed C++/CLI
project. There should be a check box or something during upgrade
wizard that enables managed C++/CLI features.
> Is keeping the project in native c++ the easiest way to move my
> project to vs2008 from vs6.0?
> Or is the managed code the way to go?
You should upgrade your project as managed if you have an
intention to interract with .NET assemblies etc from the C++ code.
Otherwise there is no any reason to make it managed. The upgrade
itself is pretty straightforward: follow the upgrade wizard, then
fix compilation errors.
However, the success of the whole process greately depends on the
health of original VC++6.0 project. I have seen very messy
projects that were unable to upgrade, VS upgrade wizard just
chocked in the process. In that case the common approach is to
create new empty project in VS2008 and add all old files and
settings one by one manually.
HTH
Alex
As you may see from my reply to Alex, I have a question on what is the best
way to upgrade a VS6.0 c++ project to use in VS2008 c++. How would I keep it
as native code? What are the implication of just keeping it as native code?
Can I keep the ported code as native and then as I develop new parts of the
program do that as managed code and have them both in the same project?
--
Thanks
Morris
The namespace directive
using namespace std;
did eliminate the problem. Maybe you can explain that?
--
Thanks
Morris
I performed more researches on the subject and find that the root cause of
the issue is a break change of _STD_USING after VC6.
In VC6, when we include the header <exception>, the std namespace is
automatically used. We do not need to additionally add the line 'using
namespace std;'. The relevant code is:
In the file ..\VC98\Include\YVALS.H (the header is used by <exception>
indirectly)
#if defined(__cplusplus)
#define _STD std::
#define _STD_BEGIN namespace std {
#define _STD_END };
#define _STD_USING
#else
.....
The line #define _STD_USING indicates that, if the current project is a
C++ project, we define _STD_USING
However, after VC6, say in VC2008, std namespace is not used by default:
.\Microsoft Visual Studio 9.0\VC\include\yvals.h
#if defined(__cplusplus)
#define _STD_BEGIN namespace std {
#define _STD_END }
#define _STD ::std::
We need to manually add the line 'using namespace std;'.
It is this change that causes the error C3646: 'exception' : unknown
override specifier when we upgrade a VC6 project to VC2008. There is no
error in the upgrade, but the default setting in the different header files
causes the problem.
Please let me know whether this explanation answers your question?
Just two questions
1. Where on my system do I see the Upgrade Wizard log?
2. I tried to use Outlook express Mail reader to access this forum and get
the following error:
-------------
502 cv.net: Access denied to your node - ne...@cv.net
Configuration:
Account: MSDN
Server: news.optonline.net
Protocol: NNTP
Port: 119
Secure(SSL): 0
Error Number: 502
Code: 800ccca0
---------
I can access other forums like microsoft.public.dotnet.framework.aspnet
which also give that error but then go on to list all the postings. But this
vc.language forum does not display any postings.
Thanks again for your help
--
Thanks
Morris
""Jialiang Ge [MSFT]"" wrote:
> Hello Morris
>
> I performed more researches on the subject and find that the root cause of
> the issue is a break change of _STD_USING after VC6.
>
> In VC6, when we include the header <exception>, the std namespace is
> automatically used. We do not need to additionally add the line 'using
> namespace std;'. The relevant code is:
>
> In the file ..\VC98\Include\YVALS.H (the header is used by <exception>
> indirectly)
>
> #if defined(__cplusplus)
> #define _STD std::
> #define _STD_BEGIN namespace std {
> #define _STD_END };
> #define _STD_USING
> #else
> ......
>
> The line #define _STD_USING indicates that, if the current project is a
> C++ project, we define _STD_USING
>
> However, after VC6, say in VC2008, std namespace is not used by default:
>
> ..\Microsoft Visual Studio 9.0\VC\include\yvals.h
Try subscribing directly to news.microsoft.com
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
Both news.microsoft.com and msnews.microsoft.com resolve to the same IP
address.
>1. Where on my system do I see the Upgrade Wizard log?
I think I was wrong in this point. Upgrading a VC6 project to VC2005/2008
does not generate a log file. It just pops up the error message in a dialog
if any error occurs. You may want to have a look at this article:
http://msdn.microsoft.com/en-us/library/60z6y467(VS.80).aspx
2. I tried to use Outlook express Mail reader to access this forum and get
the following error: ...
The setup guide can be found at
http://www.microsoft.com/windows/ie/support/newsgroups/howto.mspx
Please follow its steps to configure your Outlook Express. Let me know if
you still get the error.