error calling function ,[A call to PInvoke function unbalanced the stack]

前端 未结 3 1411
傲寒
傲寒 2021-01-18 10:48

i have following code , once i run my application i get this error

anyone know how i fix this error?

ERROR:

A call to PInvoke function \'testcamera!

3条回答
  •  有刺的猬
    2021-01-18 11:24

    Please use Cdecl calling convention for that function. Don't ask me why, it just works.

    [DllImport("EDSDK.dll", CallingConvention=CallingConvention.Cdecl)]
    public extern static uint EdsCreateEvfImageRef(IntPtr inStreamRef, out IntPtr outEvfImageRef);
    
    [DllImport("EDSDK.dll",CallingConvention=CallingConvention.Cdecl)]
    public extern static uint EdsDownloadEvfImage(IntPtr inCameraRef, IntPtr outEvfImageRef);   
    

提交回复
热议问题