I have an outdated DLL written in C that I would like to call from a C # .NET application. The problem is that the DLL interface for the C DLL is quite complex. This is something like this:
__declspec(dllexport) void __stdcall ProcessChunk(
void *p_prochdl,
const BIG_INPUT_STRC *p_inparams,
BIG_OUTPUT_STRC *p_outparams
);
BIG_INPUT_STRC / BIG_OUTPUT_STRC contains all kinds of things ... pointers to buffer arrays, enumerated parameters, integer parameters, etc. In short, they are complex.
First question: is there an easy way to get all the structure information contained in the DLL header file into the C # class, or do you need to literally copy and paste everything into C # and override it? That seems redundant.
In this regard, what is the correct way to pass structures to an unmanaged DLL from C #?
Finally, there is an example of how to properly transfer buffer arrays from C # to an unmanaged DLL? Alternatively, how can I pass a two-dimensional array to a DLL?
Thanks Greg
source
share