OpenCV and MFC - strange behaviour of cvGetWindowHandler on 32-bit and 64-bit

asked 2016-03-30 03:34:48 -0500

Graver gravatar image

updated 2016-03-30 04:33:33 -0500

berak gravatar image

I have a MFC project in Microsoft Visual Studio 2010. In my dialog I have a PictureControl. I generate a window with opencv and then i translate it to my PictureControl like this

namedWindow("INPUT", 1);
HWND hWnd = (HWND) cvGetWindowHandle("INPUT");
HWND hParent = ::GetParent(hWnd);
::SetParent(hWnd, GetDlgItem(IDC_BMP_LOAD)->m_hWnd);
::ShowWindow(hParent, SW_HIDE);

When I compile it for 32-bit arhitecture it works. When I compile for 64-bit it generate the namedwindow but doesn't hide and at the name I have a strange string like "%HO", different than "INPUT".

I tried to see if the window handler hWnd is ok and at unsued filed it gives me "CXX0030: Error: expression cannot be evaluated". In documention of OpenCV at the function cvGetWindowHandle() says that it returns a native HWND of the window refered by name in case of Win32 application.

Any help would be appreciated! Thanks.

edit retag flag offensive close merge delete