none
Migration from VC++ 6 to VS 2013

    Question

  • Hello everybody,

    We are trying to migrate a C++ code developed in VC++ 6 to VS 2013.The project is supposed to make some data calculations from received data and sent the results to the server again (more or less). The project uses standard libraries like windows.h, stdlib.h , stdio.h, string.h, memory.h, search.h, winsock2.h... and so on.

    The project is compiling with those main characteristics:

    • MFC in a shared DLL
    • Multy-Byte character set
    • With SEH Exceptions

    The project compiles. But doesn't work. The output messages are different (verified with WireShark).Then, we try the same project but in VS 2012, changing only the platform toolset to v110 and it works.

    Why can be this? Could be a change in the standard libraries affecting tho the project? Could be the MFC library?

    Thanks in advance,

    Ibon

    Friday, January 22, 2016 1:48 PM

Answers

  • Hello,

    Thanks for the suggestion, I compile the code in VS 2013 with V110 toolset and it works :S

    I have no compiling error :(

    Thenks,

    ibon

    Wednesday, January 27, 2016 11:05 AM

All replies

  • The project compiles. But doesn't work. The output messages are different (verified with WireShark).Then, we try the same project but in VS 2012, changing only the platform toolset to v110 and it works.
    Why can be this?

    You need to debug the code to determine what the differences are and
    where they arise.

    We don't know the first thing about your code, so any suggestions
    would be wild guesses.

    Dave

    Friday, January 22, 2016 4:15 PM
  • Hello Dave,

    The problem appears when we send a message from the application. Wen we uses send api of WinSock2.h

    Any suggestion? Its a really strange case.

    Thanks,

    ibon
    Tuesday, January 26, 2016 9:06 AM
  • The problem appears when we send a message from the application. Wen we uses send api of WinSock2.h
    Any suggestion?

    None, other than keep debugging and pin it down further :)

    Dave

    Tuesday, January 26, 2016 10:30 AM
  • In this point keep debugging is useless because I cant go inside ws2_32.lib. (this library is included like input and also like "#pragma comment"; WIN32_LEAN_AND_MEAN is defined too)

    I was trying to search around the forum but nobody have the same problems. TCP behaviour is crazy, it has no sense. The program is sending and receiving packets while debugging the code :S something that is not happening in VS 2012...


    • Edited by IbonDiez Tuesday, January 26, 2016 12:43 PM
    Tuesday, January 26, 2016 12:42 PM
  • >In this point keep debugging is useless because I cant go inside ws2_32.lib. (this library is included like input and also like "#pragma comment"; WIN32_LEAN_AND_MEAN is defined too)

    I suspect the problem isn't within WinSock. What's wrong/different
    with your data between the old and new? I don't want to know that
    answer, but I suspect you need to understand it.

    I'm afraid only you know how your program's supposed to work -
    assuming you've not got the job of picking up someone else's
    undocumented work :(

    Dave

    Tuesday, January 26, 2016 1:17 PM
  • "assuming you've not got the job of picking up someone else's
    undocumented work :(" This is the case :(

    I was checking, and the data is the same. The problem is while we send the info... Maybe is a new configuration in declarations or something... :S Well... we will continue trying :D

    Tuesday, January 26, 2016 1:46 PM
  • Hi lbon,

    >>Migration from VC++ 6 to VS 2013

    As far as I know. VS2013 can not support to open the projects which created in VC++6 by default.

    So if you want to migrated from VC++6 to VS2013. One idea is that you could first migrate the project to VS2010. Then migrate the project from VS2010 to VS2013.  

    In these migration progress. There might exist some compatibility or compiling issue. For these issues, you need to debug it separately.

    Please take a loot at the following document about VS2013 Compatibility:

    https://www.visualstudio.com/en-us/products/visual-studio-2013-compatibility-vs.aspx

    So the best workaround is that you'd better create a new project in VS2013 directly and copy your code into it.

    If there still exist some compiling issue, I think the cause is in your C++ code.

    In this case, if possible, please share us your Code so that we could reproduce it in our sides then we could troubleshoot the compiling issue.

    Best Regards,

    Lake Xiao


    Wednesday, January 27, 2016 6:49 AM
    Moderator
  • Hello Lake Xiao,

    We already have a functional version in 2012. Its explained in the first post.

    The problem comes in 2013, the code works as it should, but we are not sending the data, or in a strange way, to the server.

    Thanks,

    Ibon
    Wednesday, January 27, 2016 8:13 AM
  • Hi lbon,

    Please change the platform toolset to V110 in VS2013 then build your project again and check whether exist some compiling error.

    If exist some compiling error. Please share here. I suppose the project which created in VC++6 is not support to compile in VS2013 by default.

    In this case. I suggest you could follow David's suggestion to add breakpoint to your code and debug your code to determine what's the differences in your code.

    Since Our forum is discussing about VS general question like how to set/configure Visual Studio and Visual Studio tools.

    If the error is related to the code in your project. I suggest you'd better post your issue to the C++ forum for better support.

    Thanks for your understanding.

    Best Regards,

    Lake Xiao

    Wednesday, January 27, 2016 8:34 AM
    Moderator
  • Hello,

    Thanks for the suggestion, I compile the code in VS 2013 with V110 toolset and it works :S

    I have no compiling error :(

    Thenks,

    ibon

    Wednesday, January 27, 2016 11:05 AM
  • >Thanks for the suggestion, I compile the code in VS 2013 with V110 toolset and it works :S

    Beware, that's not a good solution in my opinion. By using the older
    toolset you're using the old compiler that you already knew didn't
    show a problem.

    You could have an underlying problem that just doesn't show up (by
    chance) with the older toolset.

    Have you tried building a debug build with all run-time checking
    enabled to see if that identifies a problem?

    Dave

    Wednesday, January 27, 2016 11:50 AM
  • Hello,

    No, I haven't. The program is too big to do that step by step around all the code, so we are focusing in the most critical blocks.

    I was comparing the warnings and when I am using v120 I have these ones that doesn't appear in v110

    1>c:\program files (x86)\microsoft visual studio 12.0\vc\atlmfc\include\afx.h(38): warning C4996: 'MBCS_Support_Deprecated_In_MFC': MBCS support in MFC is deprecated and may be removed in a future version of MFC.
    1>          c:\program files (x86)\microsoft visual studio 12.0\vc\atlmfc\include\afx.h(33) : see declaration of 'MBCS_Support_Deprecated_In_MFC'


    Could this affect to the program?

    Thanks,

    Ibon

    • Edited by IbonDiez Wednesday, January 27, 2016 12:24 PM
    Wednesday, January 27, 2016 12:22 PM
  • No, I haven't. The program is too big to do that step by step around all the code

    I'm not sure what you mean by that - you can enable run-time checking
    by setting the compiler settings - just executing the code will cause
    it to alert you if it finds any issues. You don't need to step around
    the code.

    I was comparing the warnings and when I am using v120 I have these ones that doesn't appear in v110
    ...
    Could this affect to the program?

    I wouldn't have thought so; it's only a warning. Presumably you've
    obtained the relevant MBCS MFC libraries if your program links OK?

    Dave

    Wednesday, January 27, 2016 2:08 PM
  • Hello,

    Ohh sorry Dave, my fault, a misunderstanding. Thanks for the recommendation!

    But it's seems that there is not any runtime error. :S

    Thanks ibon.

    • Edited by IbonDiez Thursday, January 28, 2016 10:41 AM
    Thursday, January 28, 2016 9:24 AM
  • Hi ibon,

    >>Thanks for the suggestion, I compile the code in VS 2013 with V110 toolset and it works

    Has your issue been solved?

    If you have no compiling error in VS2013. I suggest you could mark the reply which is helpful as an answer so that I can close this case. And if you have the problem about C++.

    I suggest you could post it to the C++ forum for better support.

    Thanks for your understanding.

    Best Regards,

    Lake Xiao


    Monday, February 01, 2016 2:12 AM
    Moderator
  • Hello,

    The issue still persist. I try with the VS 2015 and it works fine.so we think that there is some pragma, define... that is blocking the compiler to a proper compilation.

    Is there any error log or something similar to know why the compiler is compiling in a wrong way?

    Thanks,

    ibon

    Monday, February 01, 2016 10:34 AM
  • Hi ibon,

    >>Is there any error log or something similar to know why the compiler is compiling in a wrong way?

    I think the best way is to debug you code to find which line code exist the compiling error.

    By the way, if possible, please share us a simple of your code.

    Best Regards,

    Lake Xiao

    Tuesday, February 02, 2016 1:39 AM
    Moderator
  • Hi Lake,

    i can't share the code and this one is too big to compile line per line. We give up.

    You can close the topic,

    Thanks

    Ibon

    Tuesday, February 02, 2016 1:36 PM
  • Hi lbon,

    I will close this case now, if you have some other question about compiling error.

    You could post a new thread to the C++ forum. I think you will get a better reply there.

    Thanks so much for your understanding.

    Best Regards,

    Lake Xiao  

    Wednesday, February 03, 2016 1:38 AM
    Moderator