Menubar problem in eVC
-
I use embedded visual c++ to write a video cam software, so that the pocket PC show the screen of the cam. But my menubar does not work.(I tick the top up box) When I click the top up button in menubar, the menubar hangs. But the screen still can show the video. void CGroup7Dlg::OnPreview() { unsigned char *pbuffer = (unsigned char *)malloc(m_PrvWidth * m_PrvHeight * 3); unsigned char *rpbuffer = (unsigned char *)malloc(m_PrvWidth * m_PrvHeight * 3); if ((PreviewFrame((unsigned char*) pbuffer)) == false) AfxMessageBox(_T("Preview Frame Fail!"), MB_OK); Rectify(pbuffer, rpbuffer); //<----- a CBitmap bitmap; bitmap.CreateBitmap(m_PrvWidth, m_PrvHeight, 1, 24, rpbuffer); CVOImage image; RECT pic_rect; m_picture_window.GetWindowRect(&pic_rect); HDC picDC = ::GetDC(m_picture_window.m_hWnd ); CString path_fname; ::WriteBitmapIntoJpegFile(TEXT("\\pic1.jpg"), 80, (HBITMAP)bitmap); UpdateData(true); path_fname ="\\My Documents\\pic1.jpg"; image.Load (picDC ,path_fname ); image.Draw (picDC ,2,13 ); free(pbuffer); pbuffer = NULL; free(rpbuffer); //<-------b rpbuffer = NULL; } There will be out of memory if I comment out line b but menubar works. There will be no problem but the screen pixel is in wrong order of course. I don't know how to fix this bug. Please help...
-
I use embedded visual c++ to write a video cam software, so that the pocket PC show the screen of the cam. But my menubar does not work.(I tick the top up box) When I click the top up button in menubar, the menubar hangs. But the screen still can show the video. void CGroup7Dlg::OnPreview() { unsigned char *pbuffer = (unsigned char *)malloc(m_PrvWidth * m_PrvHeight * 3); unsigned char *rpbuffer = (unsigned char *)malloc(m_PrvWidth * m_PrvHeight * 3); if ((PreviewFrame((unsigned char*) pbuffer)) == false) AfxMessageBox(_T("Preview Frame Fail!"), MB_OK); Rectify(pbuffer, rpbuffer); //<----- a CBitmap bitmap; bitmap.CreateBitmap(m_PrvWidth, m_PrvHeight, 1, 24, rpbuffer); CVOImage image; RECT pic_rect; m_picture_window.GetWindowRect(&pic_rect); HDC picDC = ::GetDC(m_picture_window.m_hWnd ); CString path_fname; ::WriteBitmapIntoJpegFile(TEXT("\\pic1.jpg"), 80, (HBITMAP)bitmap); UpdateData(true); path_fname ="\\My Documents\\pic1.jpg"; image.Load (picDC ,path_fname ); image.Draw (picDC ,2,13 ); free(pbuffer); pbuffer = NULL; free(rpbuffer); //<-------b rpbuffer = NULL; } There will be out of memory if I comment out line b but menubar works. There will be no problem but the screen pixel is in wrong order of course. I don't know how to fix this bug. Please help...
-
-
-
New or not, in the future - and on any site - it's good to pay attention to big bold red letters, such as those on the Lounge posting page that say "Please do NOT post programming questions to this forum." :)
Microsoft MVP, Visual C# My Articles
-
New or not, in the future - and on any site - it's good to pay attention to big bold red letters, such as those on the Lounge posting page that say "Please do NOT post programming questions to this forum." :)
Microsoft MVP, Visual C# My Articles
Seems the bold red letters are not bold or red enough for some people! Perhaps all these people are colour blind and see red as white!?! ;P Ant. I'm hard, yet soft.
I'm coloured, yet clear.
I'm fuity and sweet.
I'm jelly, what am I? - David Williams (Little Britain) -
Sweet reply! :-D Yes, I program in VB, but only to feed my addiction to a warm place to sleep and food to eat!
Visit my Code Project blog (Mobile Audio project)[^]
-
Seems the bold red letters are not bold or red enough for some people! Perhaps all these people are colour blind and see red as white!?! ;P Ant. I'm hard, yet soft.
I'm coloured, yet clear.
I'm fuity and sweet.
I'm jelly, what am I? - David Williams (Little Britain)But the verbage remains the same regardless. Unless you don't read English, then it will all be greek anyway! Yes, I program in VB, but only to feed my addiction to a warm place to sleep and food to eat!
Visit my Code Project blog (Mobile Audio project)[^]
-
But the verbage remains the same regardless. Unless you don't read English, then it will all be greek anyway! Yes, I program in VB, but only to feed my addiction to a warm place to sleep and food to eat!
Visit my Code Project blog (Mobile Audio project)[^]
I was trying to say that they are seeing white text on a white background. Perhaps a little too subtlely!? :-D Ant. I'm hard, yet soft.
I'm coloured, yet clear.
I'm fuity and sweet.
I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)