Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Thursday, July 5, 2018 2:51 PM
I have code written in visual basic 6.0 and application is working fine on windows 8 and above. There is request to enhance that code to support new functionality.
I am trying to build VB code in Visual Studio 2012 using Visual Basic Tools for Visual Studio add-in/package but it failed to compiled.
Can anyone help me to identify correct Visual Studio version to build VB code as is?
All replies (23)
Thursday, July 5, 2018 4:22 PM
I think your only two choices are:
- Get VB 6
- Convert to VB.Net
See How to: Upgrade a Project from Visual Basic 6.0 for a description of the latter.
Sam Hobbs
SimpleSamples.Info
Friday, July 6, 2018 6:34 AM
Hi,
*>>I am trying to build VB code in Visual Studio 2012 using Visual Basic Tools for Visual Studio add-in/package but it failed to compiled. *
Visual Basic Tools for Visual Studio does not claim to be a feature-complete replacement for the classic VB6 IDE.
https://marketplace.visualstudio.com/items?itemName=MatthiasFriedrich.VisualBasicToolsforVisualStudio
Opening VB6 projects directly in Visual Studio 2012 and Visual Studio 2017 is not supported. If you want to open VB6 in visual studio, it is recommend to move your code to Visual Basic .NET. Earlier versions of Visual Studio (2008 and prior) did have a project upgrade wizard that would help you do this.
https://msdn.microsoft.com/en-us/library/bszew91f(v=vs.120).aspx
Best regards,
Joyce
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].
Friday, July 6, 2018 11:29 AM | 2 votes
The VB6 programming language is not part of .Net. VB.Net is a completely different language. It is unfortunate that Microsoft chooses to use the name "Visual Basic" (or VB) for a language that is incompatible with Visual Basic 6.0.
To edit and compile VB6 code you need the VB6 IDE, which is also part of Visual Studio 6.0.
If you do not have the VB6 IDE you can download it from Microsoft if you have the appropriate MSDN subscription or you can buy second-user copies from Ebay or similar sites.
Fortunately VB6 is still supported on Windows 10/Windows Server 2016.
Microsoft support VB6 programming (VB6 Support Statement, VB6 Programming IDE Installer)
Friday, July 6, 2018 4:22 PM
The VB6 programming language is not part of .Net. VB.Net is a completely different language. It is unfortunate that Microsoft chooses to use the name "Visual Basic" (or VB) for a language that is incompatible with Visual Basic 6.0.
The "part of .Net" is not relevant. Java, JavaScript and even unmanaged C++ are not "part" of .Net yet Microsoft supports those languages in Visual Studio. The critical difference is that there are third-party compilers for the other languages; the VB 6 IDEs include a VB 6 compiler (right?) that are not available separately from the IDE.
Sam Hobbs
SimpleSamples.Info
Friday, July 6, 2018 9:48 PM | 1 vote
The critical difference is that there are third-party compilers for the other languages; the VB 6 IDEs include a VB 6 compiler (right?) that are not available separately from the IDE.
VB6 uses the Microsoft C2 compiler (the C/C++ compiler).
Microsoft support VB6 programming (VB6 Support Statement, VB6 Programming IDE Installer)
Saturday, July 7, 2018 1:41 AM
VB6 uses the Microsoft C2 compiler (the C/C++ compiler).
When I say something like that I nearly always provide a link to something authoritive.
Sam Hobbs
SimpleSamples.Info
Saturday, July 7, 2018 7:38 AM | 1 vote
VB6 uses the Microsoft C2 compiler (the C/C++ compiler).
When I say something like that I nearly always provide a link to something authoritive.
Sam Hobbs
SimpleSamples.Info
Do you doubt it ?
Surely anyone who claims to know anything about VB6 programming (or VB5 for that matter) knows this. It has been the case since the launch of VB5 in 1997.
For a simple proof try Wikipedia - surely there is nothing more authoritative ;) -
"The Visual Basic compiler is shared with other Visual Studio languages (C, C++). "
https://en.wikipedia.org/wiki/Visual_Basic
C2 is the object compiler and is used to compile individual modules (such as .frm forms or .bas modules) to temporary .OBJ files before linking.
C2.exe is used in VB5 and VB6 and earlier versions of C++. Later versions of C++ use C2.dll
Component | Product Version | Compiler Description |
C2.EXE (from Visual Basic 6) | 6.0.8041.0 | 32-Bit 80x86 Compiler Back End |
C2.DLL (from Visual C++ 6) | 6.0.8168.0 | 32-Bit 80x86 Compiler Back End |
Microsoft support VB6 programming (VB6 Support Statement, VB6 Programming IDE Installer)
Saturday, July 7, 2018 4:45 PM
For a simple proof try Wikipedia - surely there is nothing more authoritative ;) -
"The Visual Basic compiler is shared with other Visual Studio languages (C, C++). "
https://en.wikipedia.org/wiki/Visual_Basic
I said authoritive. The WikiPedia is not authoritive; it requires authoritive sources. It would be appropriate to use the same authority as the WikiPedia but that portion you quoted does not have such a thing. And in this context I don't understand what "shared" means.
Even if a portion of the C/C++ compiler is used for VB, unless VB can be totally compiled using it, that does not help.
Sam Hobbs
SimpleSamples.Info
Saturday, July 7, 2018 7:50 PM | 1 vote
I said authoritive. The WikiPedia is not authoritive; it requires authoritive sources.
But I'm sure you meant authoritative.
And, as everyone knows, nothing on the internet is more authoritative than Wikipedia ;)
But if you don't like that try using Google.
Microsoft support VB6 programming (VB6 Support Statement, VB6 Programming IDE Installer)
Saturday, July 7, 2018 8:04 PM
And in this context I don't understand what "shared" means.
An OED definition of 'shared' is "Used, occupied, or enjoyed jointly with another or others."
I'd suggest you can take it to mean "also used by".
You could probably infer that meaning from my statement that VB6 uses the same compiler as C and C++
It isn't a difficult concept.
Microsoft support VB6 programming (VB6 Support Statement, VB6 Programming IDE Installer)
Saturday, July 7, 2018 8:27 PM
But I'm sure you meant authoritative.
No I meant what I said. Do you correct all spelling and grammar problems you see? Moderators must have told you many times not to do that. For this specific word, I spell It that way because I want to. People use so many crazy things that I cannot say anything about (moderators would complain if I did) that I feel entitled to spell that word the way I want to.
And, as everyone knows, nothing on the internet is more authoritative than Wikipedia ;)
But if you don't like that try using Google.
In other words you cannot find an authoritive source. Unless you can, the assumption is that what you said is not true.
Sam Hobbs
SimpleSamples.Info
Saturday, July 7, 2018 8:46 PM
But I'm sure you meant authoritative.
No I meant what I said. Do you correct all spelling and grammar problems you see? Moderators must have told you many times not to do that. For this specific word, I spell It that way because I want to. People use so many crazy things that I cannot say anything about (moderators would complain if I did) that I feel entitled to spell that word the way I want to.
Ah, I looked it up in a dikshunerry. I often find it hulpfal to use korrect spullings, that we we dun't get confoosed about what we meen. :)
Presumably it is your failure to use a dictionary that has lead to your difficulties understanding the meaning of the word "shared".
Microsoft support VB6 programming (VB6 Support Statement, VB6 Programming IDE Installer)
Saturday, July 7, 2018 8:54 PM | 1 vote
And, as everyone knows, nothing on the internet is more authoritative than Wikipedia ;)
But if you don't like that try using Google.
In other words you cannot find an authoritive source. Unless you can, the assumption is that what you said is not true.
Sam Hobbs
SimpleSamples.Info
No, the assumption is that you are unaware that VB6 uses the Microsoft C2 compiler. Either that or you are unaware that C/C++ uses the Microsoft C2 compiler.
So which is it?
.
.
Lighten up, Sam. I'm just telling you something you apparently don't know - that VB6 uses the Microsoft C++ compiler. It happens to be true, it is up to you if you want to believe it.
It is quite easy for you to check...
Look at C2.EXE in your VB98 folder (I'm sure you have VB6 installed) and compare it with C2.DLL in C++. And do the same for LINK.EXE
Or compile a VB6 project and use Task Manager to verify that C2.exe is being used.
Or ask anyone who is a competent user of VB6.
Or post the question on another site.
Or just Google it.
:) :) :)
Microsoft support VB6 programming (VB6 Support Statement, VB6 Programming IDE Installer)
Saturday, July 7, 2018 8:55 PM | 1 vote
VB6 uses the Microsoft C2 compiler (C2.EXE) to compile individual modules to temporary .OBJ files. C2 is run once for each module. Then the Microsoft C/C++ Linker 'LINK.EXE' is used to link these object files to produce an executable.
The use of the Microsoft C/C++ compiler is one reason VB6 programs can be comparable in performance to C++ programs.
So do you doubt that the VB6 programming environment uses the same compiler that C and C++ use?
Microsoft support VB6 programming (VB6 Support Statement, VB6 Programming IDE Installer)
Sunday, July 8, 2018 11:48 AM
It might be helpful if you referred to C2.exe as the back-end of the compiler.
Generally speaking, a compiler back-end is language agnostic; the front-end is responsible for taking source statements as input. The output from the front-end is then processed as the input to the back-end.
Sunday, July 8, 2018 2:35 PM
It might be helpful if you referred to C2.exe as the back-end of the compiler.
Generally speaking, a compiler back-end is language agnostic; the front-end is responsible for taking source statements as input. The output from the front-end is then processed as the input to the back-end.
Forgive me if I sometimes assume everyone knows these basic facts.
(though I did state several posts ago that C2.dll and C2.exe are "32-Bit 80x86 Compiler Back End")
C1.DLL is the first pass of the compiler from C.
C1XX.DLL is the first pass from C++.
VB6 outputs this first pass directly from the VB6 IDE.
The first pass is the parser (and some optimisation) of the source code - this creates temporary CIL(C intermediate language) code. This is then passed on to C2, which compiles this into .OBJ files. And finally to the linker LINK.EXE, which makes an executable.
As far as I know the C2 compiler is only used by C, C++ and VB5/6 though it certainly would be possible (in theory at least) to use with other languages.
It still surprises me that although it is over 20 years since VB5 started using the Visual C++ compiler many posters don't realize this is the case.
There is, of course, no technical reason Visual Studio couldn't support VB6. It would be similar to the way C++ is supported in Visual Studio.
Microsoft support VB6 programming (VB6 Support Statement, VB6 Programming IDE Installer)
Sunday, July 8, 2018 3:23 PM
Forgive me if I sometimes assume everyone knows these basic facts.
(though I did state several posts ago that C2.dll and C2.exe are "32-Bit 80x86 Compiler Back End")
I wouldn't be surprised if that nuance was lost in subsequent discussion, or possibly not visible in the forum's threaded view. :)
Sunday, July 8, 2018 4:11 PM
You still have not provided anything from Microsoft saying it is so. Anyone can say whatever they want to and then try to make it true by intimidating others, saying they are ignorant for not knowing it. Flame wars erupt from things like that. Just provide something from Microsoft saying it is so. Don't expect others to take your word for it.
Unless the C or C++ compiler is doing all of it, it is not useful here.
Sam Hobbs
SimpleSamples.Info
Sunday, July 8, 2018 5:19 PM
You still have not provided anything from Microsoft saying it is so. Anyone can say whatever they want to and then try to make it true by intimidating others, saying they are ignorant for not knowing it. Flame wars erupt from things like that. Just provide something from Microsoft saying it is so. Don't expect others to take your word for it.
Do you still doubt it? Seriously?
Which bit don't you believe? That C uses the Microsoft C2 compiler? That C++ uses the Microsoft C2 compiler? That VB6 uses the Microsoft C2 compiler?
If you are doubting that VB6 uses the Microsoft C2 compiler and the Microsoft Linker I have explained previously that you can compile a VB6 project and use Task Manager (or ProcMon) to see that it does use C2.exe and Link.exe.
Unless the C or C++ compiler is doing all of it, it is not useful here.
Useful for what? Your only point (I assume) is that Visual Studio (version 7 or later) can't support VB6 because you assume there isn't a compiler available. Even if you don't believe VB6 uses the C++ compiler, you must accept whatever compiler it uses is one developed by Microsoft and therefore could be used in Visual Studio.
There is no technical reason VB6 could not be supported in Visual Studio, just as it was in Visual Studio 6.0
Microsoft support VB6 programming (VB6 Support Statement, VB6 Programming IDE Installer)
Monday, July 9, 2018 12:05 AM
There is, of course, no technical reason Visual Studio couldn't support VB6. It would be similar to the way C++ is supported in Visual Studio.
Technically speaking I agree. I mean legally. Microsoft does not make the VB 6 compiler available for free. The question is asking how "to build VB code in Visual Studio 2012". Much of this other stuff is not relevant. How can we build VB 6 programs using VS 2012 or a later version of VS? Answer that question and leave the technical details for some other discussion.
Sam Hobbs
SimpleSamples.Info
Monday, July 9, 2018 12:08 AM
There is, of course, no technical reason Visual Studio couldn't support VB6. It would be similar to the way C++ is supported in Visual Studio.
However there is a huge technical limitation. Users of VS are accustomed to Intellisense and VB 6 users are correspondingly accustomed to the features of its IDE. VS does not have that for VB 6.
Sam Hobbs
SimpleSamples.Info
Monday, July 9, 2018 6:53 AM
There is, of course, no technical reason Visual Studio couldn't support VB6. It would be similar to the way C++ is supported in Visual Studio.
Technically speaking I agree. I mean legally. Microsoft does not make the VB 6 compiler available for free. The question is asking how "to build VB code in Visual Studio 2012". Much of this other stuff is not relevant. How can we build VB 6 programs using VS 2012 or a later version of VS? Answer that question and leave the technical details for some other discussion.
Sam Hobbs
SimpleSamples.Info
In my first reply on this thread I explained to the OP that he could not use any version of Visual Studio newer than 6.0 to build his VB6 application.
"To edit and compile VB6 code you need the VB6 IDE, which is also part of Visual Studio 6.0."
"Legally" Microsoft own the compiler. They choose whether or not to enable its use in newer releases of Microsoft Visual Studio, whether by Microsoft C++ or Microsoft VB6.
It isn't a legal issue, it isn't a technical issue.
Microsoft support VB6 programming (VB6 Support Statement, VB6 Programming IDE Installer)
Monday, July 9, 2018 6:56 AM
There is, of course, no technical reason Visual Studio couldn't support VB6. It would be similar to the way C++ is supported in Visual Studio.
However there is a huge technical limitation. Users of VS are accustomed to Intellisense and VB 6 users are correspondingly accustomed to the features of its IDE. VS does not have that for VB 6.
Sam Hobbs
SimpleSamples.Info
Microsoft's first ever use of Intellisense was in Visual Basic 5.0
Microsoft support VB6 programming (VB6 Support Statement, VB6 Programming IDE Installer)