I have .NET 3.5 web application which uses some COM dll created in VB6.
I have source code for both. Also I have pdb file for the COM dll.
I would like to load the VB6 dll code inside Visual Studio 2010 for debugging.
I am able to step into dll code from VS If I loaded the COM app in VB6 IDE.
Since I am new to VB, debugging using VB6 IDE is bit tedious for me.
So I wanted to debug the COM app code inside Visual Studio 2010.
I followed the instructions in Robgruen's Blog
The problem is VS2010 automatically creating Interop dll for the corresponding COM dll,
and It uses the Interop dll only. While debugging when I try to manually load the Symbol file for the COM dll(let's say MyComApp.dll) It fails and VS is instructing me to load Interop.MyComApp.pdb file. But I have MyComApp.pdb only.
How do I make this work?
You can not debug VB6 code in Visual Studio 2010 at any level higher than the compiled assembly code.
You can however convert your VB6 dll project to VB 2010 then use it in Visual Studio 2010.
Just drag and drop your VB6 project to Visual Studio 2010 (drag project to icon of VS 2010 then drop) and upgrade wizard will automatically convert it.
Or just use Artinsoft programs.
Good Luck! :)
Related
In Visual Studio 2010, I have a CLR C++ console project that I would like to change into a Forms project, so that I can add a form and use the designer and whatnot. Is there a good way to do this?
Compare the old project templates then make necessary changes like adding references to winforms and changing the entry point function from winmain back to main.
See http://jiangsheng.net/2012/12/17/how-to-migrating-a-clr-console-visual-c-project-to-windows-forms/ for details. This article is written for 2012 but should work in 2010.
As sort of a hello world attempt, I am compiling a simple EXE that dynamically loads a DLL (which I have also written) using only C++ files, building with Visual Studio 2010. However, when running on a new machine, an error appears that the VS2010 runtime is not present.
Is there a way to package the runtime in my application or DLL so this doesn't occur? Without using an installer program.
Alternatively, is there a way to exclude requiring the runtime at all?
(I am using Visual Studio 2010, but this could really be of interest for all versions)
Does anyone know how to add a reference to "C:\Windows\SysWOW64\mqoa30.tlb" in Visual Studio 2010 like you can in Visual Studio 2008?
If I go to Add Reference, and browse to this file: "C:\Windows\SysWOW64\mqoa30.tlb" these are the different results:
Visual Studio 2008
Added Just fine
And creates the Interop stuff
Visual Studio 2010
The error message in clear text for SEO:
Could not add a reference to C:\Windows\SysWOW64\mqoa30.tlb
Could not load file or assembly 'mqoa30.tlb' or one of its dependencies. The module was expected to contain an assembly manifest.
This file may not be a managed assembly.
Cannot add from the Add Reference Dialog and "Microsoft Messaging Queue 3.0 Type Library" is not listed already in the COM Type Libraries.
(Note: I have MSMQ installed and working fine (via NServiceBus). I am running Windows 7.)
If you know how to add the reference can you please tell me?
This is what it looks like on my version of VS2010, works fine. No clue what your screenshot might represent, some sort of add-on I guess.
Is it possible to create a VB6 application in Visual Studio 2010 for creating COM applications?
No, this is not possible. VB6 application cannot be created in any version of Visual Studio beyond Visual Studio 6.0 SP6.
You can, however, write assemblies in .Net (any version) that are "Com visible."
You can set an assembly as "Com Visible" by checking the "Make COM Visible" checkbox on the project settings dialog in whichever version of Visual Studio (that supports .Net) you choose.
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.