473,395 Members | 1,701 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Conversion of 6.0 project to VS 2003

We have just started converting a large project from VisualStudio 6.0 to VisualStudio 2003. Of course, we're encountering some problems.

The first of which involves some CString() constructors not taking arguments that were valid in the 6.0 builds.

As a test, a created a simple 2003 project and inserted the following six lines of code in the stdafx.cpp file:
#include "stdafx.h"

TCHAR x = 't';
CString s(x);

UCHAR uc = 'u';
CString s2(uc);

WCHAR wc = 'w';
CString s3(wc);
and I get the following compiler error:

c:\Temp\TestDotNet2003\TestDotNet2003\stdafx.cpp(1 5): error C2668: 'ATL::CStringT<BaseType,StringTraits>::__ctor' : ambiguous call to overloaded function
with
[
BaseType=char,
StringTraits=StrTraitMFC_DLL<char>
]
and
[
BaseType=char,
StringTraits=StrTraitMFC_DLL<char>
]


If I try the same thing with the 6.0 compiler, I get the following results:

c:\documents and settings\stevek\my documents\shamrockii_1_0\stdafx.cpp(27) : warning C4244: 'argument' : conversion from 'unsigned short' to 'char', possible loss of data
WCHAR wc = 'w';
CString s3(wc); // offending line

If in the Stdafx.cpp file of the 2003 project, I right-click on CString and select the "Go To Definition", I goto line 103 of afxstr.h

typedef ATL::CStringT< TCHAR, StrTraitMFC< TCHAR > > CString;

and then if I again right-click on TCHAR and select "Go To Definition", I get to line 141 of tchar.h

#ifndef _TCHAR_DEFINED
#if !__STDC__
typedef wchar_t TCHAR; // line 141
#endif
#define _TCHAR_DEFINED
#endif
it appears that TCHAR has a typedef of wchar_t.

If I following the same steps ("Go To Definition") I get to:

#ifndef _TCHAR_DEFINED
typedef char TCHAR, *PTCHAR; // line 324 of WinNT.h
typedef unsigned char TBYTE , *PTBYTE ;
#define _TCHAR_DEFINED
#endif /* !_TCHAR_DEFINED */

Why is TCHAR being defined as wchar_t in the VS 2003 project?

Does anyone have a list of common problems and tips we could follow while in the process of converting a large project.

Any help would be appreciated.


Nov 17 '05 #1
3 3214
SteveK wrote:
Why is TCHAR being defined as wchar_t in the VS 2003 project?


TCHAR is either char or wchar_t, depending whether the project is MBCS
or Unicode. Go to the project's configuration properties, General,
Character Set, and set it to Use Multi-Byte Character Set if you don't
want Unicode. If you do want Unicode, you have to accept that TCHAR is
wchar_t.

Tom
Nov 17 '05 #2
>have a list of common problems and tips we could follow while in the process of converting a large project.

In the case of mathimatical functions you should typecast to float/double.
For the rest nothing much different compared to VC++ 6.0

Just make sure that you have a backup, because you cannot go back to VC++ 6.0. It is a one way transition.


Nov 17 '05 #3
Tom,

I already had "Use Mult-Byte Character Set" selected. Can you think of
anywhere else this could be comming from? That is TCHAR getting defined
wchar_t?

Thanks
"Tamas Demjen" <td*****@yahoo.com> wrote in message
news:eW**************@TK2MSFTNGP10.phx.gbl...
SteveK wrote:
Why is TCHAR being defined as wchar_t in the VS 2003 project?


TCHAR is either char or wchar_t, depending whether the project is MBCS or
Unicode. Go to the project's configuration properties, General, Character
Set, and set it to Use Multi-Byte Character Set if you don't want Unicode.
If you do want Unicode, you have to accept that TCHAR is wchar_t.

Tom

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Peter Oliphant | last post by:
I've been trying all morning to convert my 2003 project (managed) to 2005 (/clr since I have both managed and unmanaged code). I'm guessing I have tens of thousands of lines of code to change. Did...
2
by: George Durzi | last post by:
Hey folks, I just installed VS .NET 2003 on top of Windows 2003 Server. I was opening a Web Project from source control, and got a warning that the project would have to be "converted", and that I...
5
by: Tom | last post by:
We currently have a rather large application that is in VB.NET 2002. We have just purchased licenses to the 2003/1.1 Framework version of Visual Studio. What kind of conversion, if any, will we...
9
by: Vince | last post by:
Hi all, I am trying to convert a VB 6 application to VB.NET 2005 using the wizard. It has over 20 forms and I've used Option Explicit everywhere, hence variables are properly declared and used....
2
by: GW | last post by:
After the conversion and fixing some errs VS2005 threw, project ran OK. Opened xxx.vbproj file after the conversion to VS2005 from VS2003. Changed (usng wordpad) ../msbuild/2003 to 2005...
0
by: StanD | last post by:
Since last Dec I have been waiting for the update that will allow me to port my projects to 2005. I have installed the download, the available update to permit me to successfully do this. I have...
5
by: JT | last post by:
Hi, I'm not sure where the problem is, but I think it's related to the .pdb file. I had a class library created in VS 2003 and decided to convert it to a VS 2005 project/solution. It seemed to...
4
by: Coleen | last post by:
Hi All :-) I'm new to this site. I've been trying to convert several .Net 2003 web applications and getting tons of conversion errors. I found this site to help walk me through the...
0
by: John | last post by:
Hi An outlook 2003 add-in solution created in vs 2008 on a pc with outlook 2007 when re-opened in vs 2008 brings up the conversion wizard. Cancelling wizard closes solution and does not allow to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.