I am making a program for loading a picture from camera using Open.Cv ..
And i am getting error in AfxMessageBox() statement..
// Add "About..." menu item to system menu.
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
int nSelected = cvcamGetCamerasCount();
if(nSelected == 0)
AfxMessageBox("Camera have no connection",MB_OK|MB_ICONSTOP);
You may, although I doubt this, have to scope it globally. To do that, try
::AfxMessageBox("Camera have no connection",MB_OK|MB_ICONSTOP);
The other is that use are building for unicode and it thinks the string is multi-byte. To do that, try
AfxMessageBox( L"Camera have no connection",MB_OK|MB_ICONSTOP);
I'm out of town, on my Mac, so I can't test this. But I have been stuck in the office on weekends so I figured I'd offer up two things to try.