VIDEOINFOHEADER *pVih = (VIDEOINFOHEADER*)pmtConfig->pbFormat;;
...
WriteFile( hHandle, pVih, sizeof(VIDEOINFOHEADER), NULL, NULL );
Through debugging I found WriteFile
reports exception, how to solve it?
VIDEOINFOHEADER *pVih = (VIDEOINFOHEADER*)pmtConfig->pbFormat;;
...
WriteFile( hHandle, pVih, sizeof(VIDEOINFOHEADER), NULL, NULL );
Through debugging I found WriteFile
reports exception, how to solve it?
Is pVih
initialized? If not, that's your problem.
follow up
Since pVih is initialized, I looked at the documentation. The fourth parameter, lpNumberOfBytesWritten, cannot be NULL if the fifth parameter, lpOverlapped, is NULL. Provide a pointer to a variable to accept the number of bytes written.
second follow up
Is pmtConfig->pbFormat
properly pointing to a VIDEOINFOHEADER
?
Probably, pmtConfig->pbFormat is NULL or invalid. Give us more details on exception, please.