Jump to content

COM Library for VB6 with VB2005 Express


Recommended Posts

Hi all!

I've got some COM library which uses such datatypes that it is impossible to use some methods and properties in VB6. But Visual Basic 2005 sees all of them properly, so it would be nice to write a very simple COM library with the same classes but the other datatypes to connect that incompatible library to Visual Basic.

Is it possible to write such a library in Visual Basic 2005 Express Edition? There's the article on how to build a COM library in MSDN 2005 Express. It proposes two ways, one uses a template which I didn't find (it seems to me that it is not included in VB2005 Express). I created the library using the second method and tried to register it with RegSvr32 and add a reference in Word 2000 VBE. But the RegSvr32 reported that it can only load the library and the referencing also was not possible.

Besides, I didn't find the checkbox mentioned in the article on the Build tab that must be checked to have the COM library compiled.

So can I build a VB6-compatible COM library with VB2005 Express? For example, can the COM template from the full version and a manual registration help to do this? If not, is it possible with the Visual Studio 2008 Professional?

Thank you for reading.

Any help would be greatly appreciated.

Link to comment
Share on other sites

  • 1 month later...

Unfortunately, what you want to do isn't possible without upgrading your VB6 code to something newer, like VB.NET. And yes, if you want the full suite for Visual Basic, you'll need to pony up for a full version of Visual Studio 2005 or 2008.

Link to comment
Share on other sites

the answer is NO

No, it is possible. I found out that there is a small trick there that helps to do this. I compared the sample project file found somewhere in the web (Sample COM library for Visual Basic 6 written in VB2005) and the simple class library generated by Visual Basic 2005 Express Application Wizard. There are only a few lines different from the Sample COM library's project file. If somebody needs to know exactly what lines should be copied to the main project file of the class library, send me a private message and I'll review the code. So I've already written the required wrappers for that COM library and the problem is solved. Furthemore, I've obtained Microsoft Visual Studio 2005 Professional and have no need to do such tricks, but it's turned out to be possible.

Link to comment
Share on other sites

Unfortunately, what you want to do isn't possible without upgrading your VB6 code to something newer, like VB.NET. And yes, if you want the full suite for Visual Basic, you'll need to pony up for a full version of Visual Studio 2005 or 2008.

No, it is possible to write a COM library recognized by Visual Basic 6 by means of Visual Basic 2005 as MSDN states.

Link to comment
Share on other sites

I stand corrected - I thought this was not possible after the first service pack, but I guess it was. Glad you're using a newer version though, should make things easier in the future as VB6 dev is no longer "supported".

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...