S
Sam Carleton
The 3rd party SDK that I would like to use in C# (I am an C/C++
programmer) is designed to be used from C/C++. This is how it
works:
The vendor is abstracting things a bit. The real DLL has only one
actual exported method, one of the parameters on the DLL takes an
enum which determines which internal function is being called.
Then the vendor provides a header file with a very large number of
enums and structs. There is also a file called function.c with
the sample which contains all the different "internal" functions
and wraps up the parameters to send through the on entry point.
To top it all off, one of the functions in the function.c goes off
to the registry, learns where the DLL is located and then does a
LoadLibrary().
I know that I re-write the whole function.c file in C# and port
the 1000+ lines of header files, too. But my objective in
working in C# is to speed things up, not slow them down
Is there an easier way of calling this SDK? I know that I can
compile the function.c as a DLL, but then the issue of the header
files remain, is there any way to include them into the managed
world without having to re-write all the structs and enums?
Sam
programmer) is designed to be used from C/C++. This is how it
works:
The vendor is abstracting things a bit. The real DLL has only one
actual exported method, one of the parameters on the DLL takes an
enum which determines which internal function is being called.
Then the vendor provides a header file with a very large number of
enums and structs. There is also a file called function.c with
the sample which contains all the different "internal" functions
and wraps up the parameters to send through the on entry point.
To top it all off, one of the functions in the function.c goes off
to the registry, learns where the DLL is located and then does a
LoadLibrary().
I know that I re-write the whole function.c file in C# and port
the 1000+ lines of header files, too. But my objective in
working in C# is to speed things up, not slow them down
Is there an easier way of calling this SDK? I know that I can
compile the function.c as a DLL, but then the issue of the header
files remain, is there any way to include them into the managed
world without having to re-write all the structs and enums?
Sam