3

I have an application which is written in VB6 and VB.Net. When reviewing changes in Team Foundation Server diff tool (in VS2012+) is possible to edit the file. The problem is that Visual Studio threats VB6 files like VB.Net and applies changes which cause syntax errors in VB6. The situation is especially annoying when merging in the merge tool.

Is it possible to either make VB6 files (.frm, .cls, ...) readonly or more preferably allow their editing as simple text (without automatic VB.Net formatting)?

Examples of destructive changes

Result is wrong syntax in VB6

Option Explicit changes to Option Explicit On

SubCall changes to SubCall() (Adds Round brackets)

b as Integer, _ changes to b as Integer, (line-continuation character ( _ ) is removed)

Partial solution

It is possible to set an external tool e.g. Winmerge for VB6 extensions (Replace diff/merge tool in Visual Studio Team System with WinMerge thx to MarkL for a hint). However setting an external tool to every developer in a company is at least annoying.

IvanH
  • 5,039
  • 14
  • 60
  • 81
  • Two languages really have many differences. VB6 was really old language, as far as I know, VS2012 doesn't support the VB6 like the .cls file or others directly, if you open it, it would really change the format or others automatically. The real reason is that the new VS2012 editor doesn't support it now, actually it will has this issue if you use the VS2008 or above, if you really want to prevent it unless you use other tools like Notepad or really update VB6 project to the VB: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2012/bszew91f(v=vs.110) – Jack Zhai Aug 23 '18 at 10:48
  • @JackZhai-MSFT: The problem is that VB6 is supported partially. So what I am looking for is some setting (hack) which either make the files with .frm, .cls, .bas extensions not editable (like e.g. .aspx) or editable as plain text **without** automatic formatting. *The process of abandoning VB6 is going on but slowly.* – IvanH Aug 23 '18 at 11:15
  • You can configure VS2015 to use an external program to do the comparisons. BeyondCompare and WinMerge are two popular ones. Lots of posts and blogs are available with instructions on how to configure visual studio for this, if you don't know how now; here's one: https://stackoverflow.com/questions/4466238/how-to-configure-visual-studio-to-use-beyond-compare – MarkL Aug 23 '18 at 14:05
  • Can you add an example or two of what it does to the VB6 files which cause problems? – StayOnTarget Aug 24 '18 at 11:13
  • @MarkL Thx for a hint I have added it to the question. – IvanH Aug 27 '18 at 08:46

0 Answers0