C++的dll 文件 函數聲明DWORD H264_PLAY_CatchPicBuf(LONG nPort, char* pBuf,LONG len,LONG *width,LONG *height,long ntype=0)我的C# 導入 函數聲明[DllImport("H264Play.dll")]public static extern int H264_PLAY_CatchPicBuf(int nPort,ref IntPtr buf,int len, ref int pwidth, ref int pheight,int type=0);C#程序中的變量定義public IntPtr ImgBuf = Marshal .AllocHGlobal(928*576*3);int getc = XMSDK.H264_PLAY_CatchPicBuf(1,ref ImgBuf,928*576*3,ref ImgWidth, ref ImgHeight, 0);相關的變量,用到的部分就是上面這些但是返回值,只有width和height,圖像的buf為空。而且調試運行至調用函數這句,報錯, (。exe停止運行)問:1. 我是不是imgbuf定義錯了,或使用錯了,沒有返回值2.我分配的空間太大導致的 停止運行 報錯?
添加回答
舉報
0/150
提交
取消