Question Call vb6 component from vb.net

rcook

New member
Joined
Sep 12, 2009
Messages
4
Programming Experience
10+
I have VB.net, Visual Studio 2008. I have a third-party component that I call from a VB6 application that I want to call from a VB.net web application.

The VB6 call looks like this:

Dim e
Set e = CreateObject("NAMEOFE.Document")
e.loadFromByteArray (byteArrayVariable)

call e.ExportToFile(p1, p2, etc)

Where loadFromByteArray and ExportToFile are functions defined in the component. This all works, so far so good.

I would like to call this same component from a web application written in VB.net. I have read some things about calling COM objects from VB.net, and the first step they give you is to run the command line program tlbimp on the dll to make a new dll. It supposedly reads the COM metadata out of the DLL and creates a new DLL compatible with VB.net.

How to do that next step I don't know yet, because I haven't gotten that far. There appear to be two DLLs and an OCX file in the installation of the component, and I get the same message for either of them when I run tlbimp: "The input file c:\blahblahblah is not a valid type library." If I run it on the OCX, I get a message saying it must be a DLL.

I am trying to navigate my way through VB and windows programming terminology from the inside out, I know. If I had had a week long class and a year of experience in windows programming, I would likely know the different kinds of things one might find under a DLL extension, but I haven't. Can someone please point me in the right direction, either to do this kind of call on this object, or some other way to invoke the functionality from VB.net?

tia,
rc
 
Back
Top