Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using 'old' dll files and header files (C++) in C#

Status
Not open for further replies.

Salte2

Programmer
Nov 5, 2004
17
0
0
NO
I've got this piece of hardware that i'm trying to get to work with my C#/.net project. It was delivered with a couple of dll files, a couple of libraries (.lib files) and a header file (and some documentation for the dll files of course).

Does anybody know how 'refrence' these, or can anyone point me to a helpful tutorial or similar?

I tried adding the dll files using 'Add Reference' (i'm using VS.net), but got an error saying they were not valid COM components.
 
Can you be more specific please? As I see it, there are 2 options:
1) the .DLL files are COM components but are not registered (using regsvr32) and that is why you cannot add a static reference to them into your project;
2) the .DLL files are simple, standard .DLLs and you will have to import each and every method you need using DllImport attribute (but in order to do that you need to know the exact method's signature - which you can get from the documentation or the header files).
 
its number 2. I was hoping there was a way of doing this without having to import all the methods one by one, but looks like i'm out of luck then.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top