如图:
解决方法:
在dllimport中添加CallingConvention = CallingConvention.Cdecl属性
[DllImport("LYCamV3.dll",
CharSet = CharSet.Ansi,
CallingConvention = CallingConvention.Cdecl)]
public static extern int LYCAM_API_Open(IntPtr pParent, int nWidth, int nHeight);
直接在c#中导入dll时添加调用属性即可。
参考文章:http://blog.csdn.net/hbqhdlc/article/details/6843650