Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Nice change to forum but Slow ! same for VC++ 6.0 to VC++ .Net !!!

bgate2000bgate2000 Member Posts: 46
I just get my shining New Visual .Net and just install it after months of saving ! I like the interfaces inside the Visual C++ . Net, coz it make me easy to work . And then when i load my program that i have been writing every single day since May last Year into my new VC .Net , i got pleinty of error messages and warnings ! I worked on fixing then for three days, coz i believe i can make it. but at least there is one remaining that i don't know how to go through:
Here is the code:
[code] CString indexBegin='A';
int maxID = 0;

for(i=0;imyLogin.GetSize();i++)
if (pDoc->myLogin[i].myID > maxID)
maxID = pDoc->myLogin[i].myID;

maxID++; // The ID of the new user.
int rest=(maxID-1)%26;
int quotien=(maxID-1)/26;

if (quotien<1)
{
[color=Red]indexBegin='A'+rest;[/color] // Error Here
if (indexBegin == "I")
{
rest++;
maxID++;
[color=Red]indexBegin='A'+rest;[/color]// Error Here also
}
}
[/code]

This code as you can see try to get the ID (ID < 26) of an user and then assign him a capitol (Majuscule in frensh ??) alphabetical letter.
This code has no prob in VC++ 6.0, but .Net think it is an error (i believe then).
The error code is :

error C2593 and the explaining message is :
.....DlgLogin.cpp(479): error C2593:

Comments

  • stoberstober Member Posts: 9,765 ✭✭✭
    Microsoft made lots of changes between those compilers. One of the changes is converting CString from a c++ class in to a template.

    >> indexBegin='A'+rest;

    it probably wants a string, not a single character. Use double quotes around 'A', not single quotes

    [code]
    indexBegin="A"+rest;
    [/code]
    Conversation should be pleasant without scurrility, witty without affectation, free without indecency, learned without conceitedness, novel without falsehood.
    William Shakespeare
  • bgate2000bgate2000 Member Posts: 46
    : Microsoft made lots of changes between those compilers. One of the
    : changes is converting CString from a c++ class in to a template.
    :
    : >> indexBegin='A'+rest;
    :
    : it probably wants a string, not a single character. Use double
    : quotes around 'A', not single quotes
    :
    : [code]:
    : indexBegin="A"+rest;
    : [/code]:
    : Conversation should be pleasant without scurrility, witty without
    : affectation, free without indecency, learned without conceitedness,
    : novel without falsehood.
    : William Shakespeare

    I got this conversion done by a replacement by TCHAR xx = 'A', then xx = 'A' + 2, some thing like that.
    Thanks for your prompt reply again !

Sign In or Register to comment.