Hey All,
How do I declare a following types:
in C# DllImport function?
C++ function signature
I tried to use an IntPtr instead of both char** and unsigned char**,
but it throws an AccessViolation Exception.
If I declare a char** (for char**) and byte** (instead of unsigned char**) I still get the same exception but it seems to me the problem in this case is because of
parameters i pass to the function(i'm not quite sure how to declare it..)
C# declarations i tried:
Can anyone please help me to solve this issue?
Thanks in advance
How do I declare a following types:
Code:
char** unsigned char**
C++ function signature
Code:
----------------------------------------------------------------------------------------------------------- extern "C" __declspec(dllimport) int Get (int* pEnrollNumber, char** EnrollNames, int* EnrollIDs, unsigned char** EnrollTemplates, int* EnrollTemplateSizes, int Delay); -----------------------------------------------------------------------------------------------------------
but it throws an AccessViolation Exception.
If I declare a char** (for char**) and byte** (instead of unsigned char**) I still get the same exception but it seems to me the problem in this case is because of
parameters i pass to the function(i'm not quite sure how to declare it..)
C# declarations i tried:
Code:
[DllImport("TLib.dll")] private static extern int EnrollGet ( ref int pEnrollNumber, char** EnrollNames, ref int EnrollIDs, byte** EnrollTemplates, ref int EnrollTemplateSizes, int Delay); or [DllImport("TLib.dll")] private static extern int EnrollGet ( ref int pEnrollNumber, out IntPtr EnrollNames, ref int EnrollIDs, out IntPtr EnrollTemplates, ref int EnrollTemplateSizes, int Delay);
Thanks in advance
Comment