9

Is one able to compile VB 6 code in Visual Studio.NET ? In other words, is it backwards compatible with older VB code?

Since I know there is a difference between managed code (.NET) and unmanaged code, I am wondering if Visual Studio.NET is able to compile unmanaged code as well?

Kind regards, Kris

0

4 Answers 4

7

While you cannot compile vb6 in the .net Visual Studios, you may use interop libraries to allow vb.6 to utilize managed code http://msdn.microsoft.com/en-us/library/kew41ycz%28VS.71%29.aspx

Sign up to request clarification or add additional context in comments.

1 Comment

+1 Good advice. Microsoft UK have some more good advice for people with "legacy" VB6 code here - it covers interop and other issues.
4

No, you can't compile VB6 code in any VS.NET version.

2 Comments

So basically all new Visual Studio versions since .NET don't support VB6 code anymore right? There does not exist such things as Visual Studio 2003.
I'm afraid not. There is no version of Visual Studio that will compile VB6 code. Your best bet, as tanging suggests, is to use COM Interop to access your VB 6 code, if that is what you wish.
2

You can open a VB6 .vbp project file in Visual Studio. This automatically invokes the project converter, it will try to translate your VB6 code into VB.NET. The translator does a fairly decent job of it but the VB.NET language has changed pretty drastically. It depends on how 'clean' your VB6 code was.

After the conversion is completed, you'll have to walk through the list of warnings and errors you'll get. Getting none at all is rare. There might be hundreds or thousands. If you're in that boat, it starts making sense to rewrite the code.

Anyhoo, just try and see what hits the fan. You'll have a good idea what you're in for in about ten minutes. Don't forget to copy the project before you start the conversion.

1 Comment

I would add, there's lots more advice about VB6 migration in the questions tagged vb6-migration
1

No it is not compatible. I think there is an upgrade wizard, but you will end up fixing some stuff manually.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.