Hi folks, my executable is throwing an exeception error. Please can anyone help me evaluate this?
Message window:
Unhandled exception at 0x7831c5c2 in MVM.exe: 0xC0000005: Access violation reading location 0x00000000
Debugger dialog:
Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.MFCLOC_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_3415f6d0\mfc80ENU.dll', Binary was not built with debug information.The thread 'Win32 Thread' (0xad8) has exited with code 0 (0x0).
Unhandled exception at 0x7831c5c2 in MVM.exe: 0xC0000005: Access violation reading location 0x00000000.
Here is my code:
#include "stdafx.h"
#include <iostream>
using namespace std;
int main (void)
{
/* Input Values */
LPCSTR filterName = "MVMCam";
CapInfoStruct m_capInfo;
/* Initialise capInfo here */
ZeroMemory(&m_capInfo,sizeof(m_capInfo));
/* Output Values */
HANDLE hDriver;
int nIndex;
int rt=FclInitialize("FC Lab Imaging Module",nIndex,m_capInfo,&hDriver);
if(ResSuccess != rt){
FclUninitialize(&hDriver);
//AfxMessageBox("Can not open USB camera!");
}
// Test message below
AfxMessageBox(_T("Operation Failed."), MB_ICONERROR);
return 42;
}
:wub:
Since you said
here that CapInfoStruct is an IN parameter, my guess is that something in there isn't meant to be NULL since the error "Access violation reading location 0x00000000" shows that something is trying to read from a NULL pointer.