1

As soon as I open a .cls file in Visual Studio 2012 many parts of the code are automatically changed.

For example:

Set objHTTP = CreateObject("MSXML2.XMLHTTP")

becomes

objHTTP = CreateObject("MSXML2.XMLHTTP")

And

objHTTP.open "POST", strURL, False

becomes

objHTTP.open("POST", strURL, False)

When I go to build these changes break the build, and I only noticed the changes when viewing the current version of code with the previous. I'm not an expert with VB6 and these changes weren't obvious!

Jack
  • 14,939
  • 19
  • 64
  • 92
  • 3
    Why would you open VB6 files in a VB.NET IDE in the first place? They are different languages. – GSerg Jul 16 '13 at 08:51
  • 2
    It converted from VB6 to VB.NET syntax. Maybe you ought to use a different text editor :) – Hans Passant Jul 16 '13 at 09:24
  • The main reason for using Visual Studio is that I often have C# files open and I use TFS etc. Sometimes i'll be checking in C# code alongside VB6 as a single changeset, but if there's no way of switching it off i'll use notepad++ for VB6 :) – Jack Jul 16 '13 at 12:01

1 Answers1

4

VB6 and VB.Net are very different animals.

The changes you see are because the syntax has also changed in a big way. It is not possible to open a VB6 project in Visual Studio 2012 and run it. Moving an application to VB.Net is a major task, sometimes meaning a rewrite is required.

For more, see: What are the differences between VB.NET and previous versions of VB?

Community
  • 1
  • 1
Luke Wage
  • 693
  • 4
  • 12
  • +1 with a quibble. Moving a VB6 application to VB.Net does not always mean that a rewrite is required. There are third-party migration tools that can ease the pain. See [some of the other questions](http://stackoverflow.com/questions/tagged/vb6-migration?sort=votes&pagesize=50) – MarkJ Jul 16 '13 at 15:50
  • @MarkJ: Feel free to edit my answer with a better terminology. – Luke Wage Jul 17 '13 at 06:22