Old DLL access from .Net

riversr

Member
Joined
Oct 30, 2006
Messages
12
Programming Experience
3-5
I have a vendor provided dll that I need to use in a VB.net appliction. I have had no succes in gaining access to the dll. When I try to add a reference to it I get this message:

A reference to c:\program files\xxxxx.dll could not be added. Please make sure the file is accessible and that it is valid assembly or COM component.

I also tried registering it. That gave me this message:

xxxxx.dll was loaded, but the DllRegisterServer entry point was not found. This file can not be registered.

I suspect that the DLL is an older incompatible version but I don't have enough experience with this sort of thing to know how to handle it. Is there a way for me to gain access to the routines in the dll file from VB.net?

Any help would be greatly appreciated. I really need to get this thing working.

rivers
 
Obviously the library is not a COM component, otherwise you'd be able to register it as a COM component and reference it via COM Interop. Speak to the vendor and ask how it's supposed to be accessed. It's probably written in C/C++ and exports functions. You would then access those functions as you would Windows API functions: by declaring corresponding functions in your own code using the Declare key word or the DllImport attribute.
 
You are correct

Luckily I found an example of how to use the dll after I made my post. You are exactly correct. The example used "decalre" statements to delacre the available functions. I also found a newer version of the dll that is VB.net compatible for which I can just add a reference. That made life much easier for me.

Thanks for the help.

rivers
 
Back
Top