I’ve got a DLL that is written in C++ and I want to create a C# wrapper for
it. I know this can be done, but I’m not sure how
to go about this. I’ve got VS 2010 and I’ve been looking on the net, but
not alot of clear definitions out there. For now, until I get he hang of it,
my c++ DLL is pretty basic, as it only has functions that take in and return
integers.
Can anyone provide an example, or point to a good place on the web?
You need to declare a (static) method with the
externkeyword to stand in for the native function and use theDllImportcustom attribute on it.There is a tutorial on consuming unmanaged DLL functions on MSDN.