Click here to Skip to main content
16,017,261 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: error C2061: Please Help Pin
Programm3r1-Jun-07 3:47
Programm3r1-Jun-07 3:47 
QuestionHow to get handle of icons on ToolBar ? Pin
Atul2331-May-07 22:29
Atul2331-May-07 22:29 
QuestionVS6 --> VS2005 Pin
Rene D31-May-07 21:29
Rene D31-May-07 21:29 
AnswerRe: VS6 --> VS2005 Pin
Christian Graus31-May-07 21:41
protectorChristian Graus31-May-07 21:41 
GeneralRe: VS6 --> VS2005 Pin
Stephen Hewitt31-May-07 22:21
Stephen Hewitt31-May-07 22:21 
GeneralRe: VS6 --> VS2005 Pin
#realJSOP1-Jun-07 3:42
professional#realJSOP1-Jun-07 3:42 
AnswerRe: VS6 --> VS2005 Pin
toxcct31-May-07 22:17
toxcct31-May-07 22:17 
AnswerRe: VS6 --> VS2005 Pin
#realJSOP1-Jun-07 3:12
professional#realJSOP1-Jun-07 3:12 
There is a service pack available, and the comments below concerning COledateTime are no longer completely correct, but there are issues that we encountered that everyone should be aware of.

If you use any CRT functions, be prepared to see dozens - if not hundreds or thousands - of warnings regarding deprecated code. The easy fix is to add a compiler definition (_CRT_SECURE_NO_DEPRECATE) to your project settings, and that will address almost all of those. The hard fix is to actually replace all of those deprecated function calls to the secure versions. This will take a lot longer than a simple compiler directive.

VS2005 also flags other things that VC6 ignores, such as const definitions that don't have a specified type. VC65 defaulted such items to int, but VS2005 throws up a warning about it.

Another bugaboo is handling of for loops. The loop control variable is scoped more tightly (and according to the ANSII standard) so that you are required to re-declare the variable for each for loop. So, this:

for (int i = 0; i < 5; i++)
{
    // do something
}

for (i = 0; i < 5; i++)
{
    // do something
}


will generate and compile error. You need to do it this way:

for (int i = 0; i < 5; i++)
{
    // do something
}

for (int i = 0; i < 5; i++)
{
    // do something
}


or this way:

int i;
for (i = 0; i < 5; i++)
{
    // do something
}

for (i = 0; i < 5; i++)
{
    // do something
}


There are MANY changes to MFC. The most damaging involves COleDateTime. It seems MS decided that a m_dt value of 0.0 (12/31/1899) is now COleDateTime::invalid, despite the fact that COleDateTime supports dates all the way back to 12/31/100 (generates a negative value for m_dt). What a pain in the ass.

There are also many deprecated functions, and the compiler doesn't like some ported message handling code due to its more strict type compliance.

The IDE is NOT friendly to unmanaged C++/MFC programmers. In a word, it SUCKS.

In closing, I think the compiler helps you to fix things in your code that would never have been found with VC6. There are now "secure" versions of most of the CRT string-related functions that help to prevent buffer overflows. I think it's a good idea to port to VS2005 because you should always use the latest tools when developing apps. Make double-damn sure you regression test EVERYTHING, *especially* if it involves date handling, and before porting, install the service pack so you only have to deal with date problems one time.




"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001


GeneralRe: VS6 --&gt; VS2005 Pin
Rene D1-Jun-07 3:30
Rene D1-Jun-07 3:30 
GeneralRe: VS6 --&gt; VS2005 Pin
David Crow1-Jun-07 3:54
David Crow1-Jun-07 3:54 
GeneralRe: VS6 --&amp;gt; VS2005 Pin
#realJSOP1-Jun-07 3:56
professional#realJSOP1-Jun-07 3:56 
GeneralRe: VS6 --&amp;gt; VS2005 Pin
Mark Salsbery1-Jun-07 6:03
Mark Salsbery1-Jun-07 6:03 
GeneralRe: VS6 --&amp;gt; VS2005 Pin
#realJSOP1-Jun-07 6:55
professional#realJSOP1-Jun-07 6:55 
GeneralRe: VS6 --&amp;gt; VS2005 Pin
Mark Salsbery1-Jun-07 7:36
Mark Salsbery1-Jun-07 7:36 
GeneralRe: VS6 --&amp;gt; VS2005 Pin
#realJSOP1-Jun-07 8:58
professional#realJSOP1-Jun-07 8:58 
QuestionToggling between Start and Stop of my service causing crash Pin
NiceNaidu31-May-07 21:09
NiceNaidu31-May-07 21:09 
QuestionRe: Toggling between Start and Stop of my service causing crash Pin
Mark Salsbery1-Jun-07 6:05
Mark Salsbery1-Jun-07 6:05 
AnswerRe: Toggling between Start and Stop of my service causing crash Pin
NiceNaidu4-Jun-07 3:45
NiceNaidu4-Jun-07 3:45 
GeneralRe: Toggling between Start and Stop of my service causing crash Pin
Mark Salsbery4-Jun-07 4:24
Mark Salsbery4-Jun-07 4:24 
GeneralRe: Toggling between Start and Stop of my service causing crash Pin
NiceNaidu10-Jun-07 17:34
NiceNaidu10-Jun-07 17:34 
QuestionProblem in opening a hard drive in raw format Pin
Srinivas Kaparthi31-May-07 20:40
Srinivas Kaparthi31-May-07 20:40 
AnswerRe: Problem in opening a hard drive in raw format Pin
Cedric Moonen31-May-07 20:54
Cedric Moonen31-May-07 20:54 
GeneralRe: Problem in opening a hard drive in raw format Pin
Srinivas Kaparthi3-Jun-07 22:32
Srinivas Kaparthi3-Jun-07 22:32 
GeneralRe: Problem in opening a hard drive in raw format Pin
Cedric Moonen3-Jun-07 23:42
Cedric Moonen3-Jun-07 23:42 
GeneralRe: Problem in opening a hard drive in raw format Pin
kakan4-Jun-07 19:24
professionalkakan4-Jun-07 19:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.