I have some doubts related to Vb 6.
I want to create an VB 6 application and very much familiar with visual studio.
So can I use Visual studio as a editor instead of VB 6 editor.
Can I use dll in vb 6. So I can cover maximum code in C#.
Please let me know your suggestions regarding this.
Thanks
No.
1 - Due to the syntax changes between VB.NET and VB6 the editor will not work. For example if you write:
Set Foo=Bar the VB.NET editor will remove the Set.
2 - Yes you can use a VB6 DLL in a C# or VB.NET project this should be not issue, but you wont be able to edit or compile it is Visual Studio.
Note:
You used to be able to 'convert' VB6 apps in Visual Studio Version prior to 2010 by using the Visual Studio Upgrade Wizard, but that feature is not available anymore.
Note that you can debug VB6 code in Visual Studio, when the .pdb files are available, but the code will be seen as VB.NET code by the syntax display. You just need to turn on "native" debugging.
Related
I want to open a program (written in Visual basic 6) to be open in Visual Studio.net. Please guide, how could I do that?
While trying to open VB6 (.vbp file) program directly from the OPEN project option in visual studion.net, I was getting this error,
"Visual Basic 6 (.vbp) files cannot be opened in Visual Studio"
I am trying to open in VS 2010.
Visual Studio 2010 does not support VB6 projects. See the link here
From the msdn documentation:
Visual Studio 2010 does not provide tools for upgrading applications and projects from Visual Basic 6.0. If you want to upgrade your project from Visual Basic 6.0 to Visual Basic 2010, you can use the upgrade tools provided with earlier versions of Visual Studio and then upgrade the project again in Visual Studio 2010.
Visual Basic Tools for Visual Studio
There's a plugin called Visual Basic Tools for Visual Studio that provides the following features:
load classic VB workspace- and project-files and offers quick access to the extension´s options
integrates with the solution explorer and the code editor having support for syntax highlighting, basic outlining (allows to expand/collapse methods, properties and types) as well as navigation bar support.
Classes, Types, Modules, Forms and Controls can be inspected using the Object Browser and Class View.
From the reading, it's unclear if you can actually build the project, though it does say:
The import tool creates a new solution and MSBuild compatible projects.
Links to the plugin by VS Version
2012-2013
2015
2017
RAD Basic
There is also an independent IDE called RAD Basic that claims the following features:
New and modern IDE (Integrated Development Environment) with form designer supporting drag and drop, code completion, refactoring tools, etc.
RAD Basic Compiler: Compiler 100% compatible with your VB6 project (vbp, frm, bas and cls files). Generate native executables (exe and ocx) in both 32-bit and 64-bit.
RAD Basic Forms: Reimplementation of common VB6 controls and components supporting 32-bit and 64-bit.
etc.
Speaking from my experience, it's not easy to open a Visual Basic 6.0 project in any versions of Visual Studio above 2008.
Although 2008 and below versions do provide an automatic function to convert Vb6 code to the VB.net framework. But, the problem starts after the conversion - it can skip some code, add functions/variables on its own, or modify the functional behavior on its own, and with that the VB.proj will be created with errors and you will not be able to open it anywhere as a solution file. The same with any 3rd party tools.
If you want to open the VB6 code try Visual Basic 6.0 Portable edition.
But headache will still follow you there, please refer this link
Installation of VB6 on Windows 7 / 8 / 10
Make sure you are clicking on the project file itself... Right click on the file and select "Open With" and select your visual studio program. It may need to be converted and if so, it will prompt you to convert the project.
Thanks!
Download Visual Basic Tools for Visual Studio,allows to work with classic VB workspaces and projects
The reason I need this is I'm porting a VB6 app and I'm getting a very small difference in the arithmetic between VB6 and C#. I just need to test a couple calculations. The one I'm most interested in is how this comes out:
Round(2.24984, 1)
If that comes out to 2.3 in VB6 I'm done, it's figured out. But if not there are a couple steps leading up to that which could also be the problem.
An online VB6 fiddle would be ideal but I can install a virtual machine if I have to.
No, you cannot compile a VB6 project directly in Visual Studio 2017.
What you can do is open the project in Visual Studio 2008 and migrate it to VB.Net using the Visual Basic Update Wizard. (The migrated code will likely have errors you will have to fix yourself.) Once this is done, you can open the migrated project in Visual Studio 2017 (the current production release of Visual Studio).
If Visual Studio includes Visual Basic, why can't I open a VB 6.0 file in Visual Studio 2010?
Because there's a difference between Visual Basic 6.0 and Visual Basic .NET which is what Visual Studio 2010 includes.
Darin is basically right but omits an important detail.
There's a difference between VB6 and VB.Net, and Visual Studio 2010 includes VB.Net
Earlier versions of VB.Net included an upgrade wizard to help convert VB6 code to VB.Net. This was dropped in Visual Studion 2010. You might want to use Visual Studio 2008 to help upgrade your VB6 to VB.Net, and then migrate to Visual Studio 2010 later. Upgrading VB6 to VB.Net can be a large task.
That's correct. I upgrade to 2008 then to 2010. You have to run the installed program from vb6 first then it will upgrade. You might have terminal failures from unfound assemblies. Go into the .vb form file with a text editor. REM out any failed to load assemblies from the fail report. Then you can re-write the VB code for code errors as the lingo changed. Next upgrade to vb 2010 using that wizard and re-write for new lingo again.
Form sizes are converted to vb6. in 2008, then that is scrapped in 2010, don't re-write that in 2008, if you're upgrading right away, you'll have to re-write in 2010 anyway.
Common file open/save/browse/color/font routines become vb powerpacks 10 which you load with your vb 2010 assembly. You have to re-insert the new common assemblies into the form from the toolbox and re-work the code. There's a bunch of stuff there, but it is do-able.
I have not used VS 2010, but based on my readings, the latest VB is effectively a new language altogether. Since introduction of VB .NET, VB 6.0 has become a stagnant language.
I come from a C# background but we have an app that is written a long time ago and is a vbp project file
What development enviroment will open that file - I know cls and frm files are class and form files but have never used vbp projects
This is a Visual Basic project file for vb6. Visual Studio should be able to open this file but you will need the VB6 IDE.
Update: As of Visual Studio 2010, VB6 projects are no longer supported. VB6 is still supported by Microsoft, but you will need the specific IDE for it to perform project updates. As of 9 February 2018, this can be found on the VB6 support site.
You need the original VB6 IDE.
Versions of Visual Studio from 2003 - 2010 will attempt to migrate the VB6 to VB.Net, but this usually introduces significant errors which are difficult to fix.
If you have an MSDN subscription, you can download Visual Basic 6 free.
Otherwise try somewhere like eBay, although VB6 is often surprisingly expensive.
Once you have obtained the VB6 IDE, look at the VB6 IDE tools-and-tricks question for some good tips and free add-ins for improving the development experience.
Visual Basic 6 creates projects which have the extension vbp. I think it stands for Visual Basic Project (obviously).
As Joel suggested in his answer, you can use the VB6 IDE to open the file.
Since you stated that you have a C# background, I take the liberty to assume that you're using Visual Studio. If that's the case, you can open the project with visual studio and it will be automatically upgraded for you.
You must note, however, that the project will be 'upgraded' to VB.NET.
If the project was large and fairly complicated, you'll have to be prepared for quite some time correcting errors. VB6 and VB.NET are quite different you know.
Plus, unless you fix all the errors in the upgraded project, you can't convert the code to C# or any other .NET language.
You need the VB 6 IDE Microsoft Visual studio
Can anyone guide me ,whether is aany method to open a VB6 code from Visual Studio 2010?
Or i need to download VB 6 Compiler separately?(If yes, then please send the link from where i can download the VB6 or guide me from where i can download it?)
Visual Studio (starting with Visual Studio .NET 2002) does not compile Visual Basic 6.0 projects. You will need to legally obtain Visual Basic 6.0 to compile the code.
If you just need the Visual Basic 6.0 runtime, most modern Windows versions have it installed.
No you can't, you'll need a copy of Visual Basic 6. You can get it from MSDN.