Old Component in C#

  • Thread starter Thread starter kjartan
  • Start date Start date
K

kjartan

Hi,

I've got a digital IO card that has a dll and a lib file to use with C++.
How Can I use this in C#?

thanx
 
Look into the P/Invoke services, and depending on the .dll, perhaps COM
interop, if it provides COM objects, in .NET for accessing unmanaged code.

Pete
 
kjartan,

If the dll file exposes all the functions that you need (and assuming
that it exports functions, and not classes), you can make the calls to the
exported functions by making the declarations in C#, using the DllImport
attribute.

If the lib is what exposes the functions, and they are not exported
through a DLL, then you will have to create a dll which makes the calls to
the lib file, and then exposes those functions in a manner which can be
called through .NET.

Hope this helps.
 
Back
Top