C++的dll 文件 函數(shù)聲明DWORD H264_PLAY_CatchPicBuf(LONG nPort, char* pBuf,LONG len,LONG *width,LONG *height,long ntype=0)我的C# 導(dǎo)入 函數(shù)聲明[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);相關(guān)的變量,用到的部分就是上面這些但是返回值,只有width和height,圖像的buf為空。而且調(diào)試運(yùn)行至調(diào)用函數(shù)這句,報(bào)錯, (。exe停止運(yùn)行)問:1. 我是不是imgbuf定義錯了,或使用錯了,沒有返回值2.我分配的空間太大導(dǎo)致的 停止運(yùn)行 報(bào)錯?
添加回答
舉報(bào)
0/150
提交
取消