Ask Your Question

opencv use callback function Unhandled exception

asked 2014-08-16 09:05:24 -0500

qmail03 gravatar image

updated 2014-08-16 14:34:38 -0500

berak gravatar image

my ipcam have SDK,there is a callback function to read the image data,below is the code.When I use opencv read and display the picture, it will display an error,Unhandled exception .But I use printf ("% lld", pBuffer); does not make mistakes,why?


void CALLBACK RealDataCallBackEx(LONG lRealHandle, DWORD dwDataType, BYTE *pBuffer,DWORD dwBufSize, LONG lParam,

DWORD dwUser)

{ IplImage* frame; frame = cvCreateImageHeader(cvSize(1280,720),IPL_DEPTH_8U,3);



//The following code will go wrong


} image description image description

edit retag flag offensive close merge delete


  • chinese screenshots aren't helpful at all (to the rest of the world)
  • using opencv's deprecated c-api is a dead end.
  • did you ever try : VideoCapture("some://protocol/some/url"); instead ?
berak gravatar imageberak ( 2014-08-16 14:32:14 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2014-08-16 15:23:37 -0500

Copy all the opencv dll files (look for them inside the OpenCV directory, which's the one you specified when installed the OpenCV library) to your Visual Studio Project DLLs directory. Finally, add the OpenCV dlls to your Visual Studio project dependencies (Solution Explorer, choose Property Pages from the View menu, select project dependencies from common properties).

edit flag offensive delete link more
Login/Signup to Answer

Question Tools


Asked: 2014-08-16 09:05:24 -0500

Seen: 108 times

Last updated: Aug 16 '14