Prev: Broken code when compiled with SDK 6.1
Next: CString
From: Alex Blekhman on 6 Jan 2009 10:14 "Morris Neuman" wrote: > [...] how do I just migrate the vs6.0 c++ project to a vs2008 > native c++ vs the managed code the compiler automatically > upgraded the project to? 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
From: Morris Neuman on 6 Jan 2009 11:00 I will try using the #include<exception>. Where (what folder/file) do I see if VS2008 generated any error reports in the upgrade wizard? I can run the wizard again If I need to. 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 ""Jialiang Ge [MSFT]"" wrote: > Hello Morris > > 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 (jialge(a)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: > msdnmg(a)microsoft.com. > > This posting is provided "AS IS" with no warranties, and confers no rights. > ================================================= > >
From: Morris Neuman on 6 Jan 2009 11:02 Dave Thanks for your reply. I believe if you read the other replies they have good reference articles and input on the issue that helped. -- Thanks Morris "David Lowndes" wrote: > >The following function declaration of a pure virtual funtion from a C++ VS6.0 > >project that I am porting to vs2008 C++: > > > > 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++? > > 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 >
From: Morris Neuman on 7 Jan 2009 00:11 I tried your code change, the include statement #include <exception> had no effect on the error. The namespace directive using namespace std; did eliminate the problem. Maybe you can explain that? -- Thanks Morris ""Jialiang Ge [MSFT]"" wrote: > Hello Morris > > 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 (jialge(a)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: > msdnmg(a)microsoft.com. > > This posting is provided "AS IS" with no warranties, and confers no rights. > ================================================= > >
From: "Jialiang Ge [MSFT]" on 7 Jan 2009 03:57
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 #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? Regards, Jialiang Ge (jialge(a)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: msdnmg(a)microsoft.com. This posting is provided "AS IS" with no warranties, and confers no rights. ================================================= |