Solved

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

Posted on 2008-06-10
5
1,019 Views
Last Modified: 2013-12-17
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
Comment
Question by:pdarata
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 39

Expert Comment

by:appari
ID: 21756794
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
 

Author Comment

by:pdarata
ID: 21756859
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
 
LVL 39

Expert Comment

by:appari
ID: 21757274
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
 
LVL 7

Accepted Solution

by:
Dauhee earned 500 total points
ID: 21758184
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
 

Author Comment

by:pdarata
ID: 21847156
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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question