I need to call native function
long (WINAPI*)(long,long*);
In long* it will give me the result
i am doing this
[DllImport("mrfw.dll", EntryPoint = "_McammGetCurrentBinning@8")]
static long Get_Current_Binning(Int32, IntPtr);
but this call is not working
Int32 Camera_Index= 0;
Int32 Result;
IntPtr Result_Pointer = IntPtr(Result);
long Binning = Get_Current_Binning(Camera_Index, Result_Pointer);
I have the exception System.AccessViolationException So, function can not write me the result.
How to do this?
Thank you.
Update
Hey guys. I do not know what you all mean, but i did ask, what i did ask.
-I am using c++ cli. it is not c#
-I need pinvoke. I can not call unmanaget dll from cli project
-i did found the solution by doing this. You can delete my answers, give me the minuses, but it is working. It is so bad?
[DllImport("mrfw.dll", EntryPoint = "_McammGetCurrentBinning@8")]
static long Get_Current_Binning(Int32, IntPtr);
int main(array<System::String ^> ^args)
{
Int32 Camera_Index= 0;
Byte* Result= new Byte(4);
IntPtr Result_Pointer = IntPtr(Result);
long Binning = Get_Current_Binning(Camera_Index, Result_Pointer);
}