2013年1月14日

解决:对 PInvoke 函数的调用导致堆栈不对称问题

摘要: 问题描述: 在使用托管代码调用非托管代码时,发生“对 PInvoke 函数“UseTwiHikVisionDllTest!UseTwiHikVisionDllTest.TwiHikVision::GetFirstPic”的调用导致堆栈不对称。原因可能是托管的 PInvoke 签名与非托管的目标签名不匹配。请检查 PInvoke 签名的调用约定和参数与非托管的目标签名是否匹配。”解决方法: 添加属性:CallingConvention=CallingConvention.Cdecl如: [DllImport("TwiHikVision.dll", EntryPoint=&qu 阅读全文

posted @ 2013-01-14 20:24 3S 天空 阅读(1010) 评论(0) 推荐(0) 编辑

C#调用DLL文件时参数对应表

摘要: Wtypes.h 中的非托管类型非托管 C 语言类型托管类名说明HANDLEvoid*System.IntPtr32 位BYTEunsigned charSystem.Byte8 位SHORTshortSystem.Int1616 位WORDunsigned shortSystem.UInt1616 位INTintSystem.Int3232 位UINTunsigned intSystem.UInt3232 位LONGlongSystem.Int3232 位BOOLlongSystem.Int3232 位DWORDunsigned longSystem.UInt3232 位ULONGunsig 阅读全文

posted @ 2013-01-14 20:23 3S 天空 阅读(1937) 评论(0) 推荐(0) 编辑

导航