• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1065
  • Last Modified:

Using a VB6 DLL w/o a tlb file in a .NET application

I am working with a piece of equipment from a third-party vendor that came with a DLL and a sample VB6 application.  I need to use the supplied DLL in a .NET app written in C#.  I tried to add the DLL as a reference but got an error telling me to make sure the DLL was a valid assembly or COM component.  The vendor supplied the DLL and a .lib file but no .tlb file.  How can I access the DLL from my C# application?

Thanks in advance!
0
pdarata
Asked:
pdarata
  • 2
  • 2
1 Solution
 
appariCommented:
is the dll registered on the system you are trying to add the reference?
check if you are able to use the dll file from vb application?
if it is not registered try running the followig command and try to add the reference again.

regsvr32 yourdllpath

0
 
pdarataAuthor Commented:
I should have mentioned before that when I run regsvr32 I get the error "LoadLibrary...failed. - The specified procedure could not be found."

Unfortunately, I no longer have a Visual Studio 6 environment set up to test with.  I could supply the dll if that would be helpful.
0
 
appariCommented:
may be the dll is not activex dll.
is the sample vb6 application provided with the dll is big? can you open each of the form or bas modules in some
text editor and see if there are any declare statements referencing the dll file. just search for the dllfilename.dll if you find any declares post them here
0
 
DauheeCommented:
the dll may be corrupt. Might be worth getting it sent from the vendor again.

also you can use a depends.exe tool (available from microsoft) to look inside the dll to see what dependancies it has - just in case you need something else installed on your system before you can register the dll.

If the DLL is from VB then it will be COM compaitible and available to .NET via interop. It would be a good idea to get a copy of Visual studio 6 to try compile the dll yourself.
0
 
pdarataAuthor Commented:
Apparently the vendor sent a debug version of their dll and I did not have the correct version of the runtime dll to support it.  Once I installed the right version of MSVCRTD.dll I was able to access the vendor's DLL.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now