Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Menubar problem in eVC

Menubar problem in eVC

Scheduled Pinned Locked Moved The Lounge
helpc++graphicshardwareperformance
9 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    group7
    wrote on last edited by
    #1

    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...

    M 1 Reply Last reply
    0
    • G group7

      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...

      M Offline
      M Offline
      Matt Newman
      wrote on last edited by
      #2

      Yeah i ran into this bug too, I think I solved it by posting the question in the correct forum. Matt Newman
      All rise for the honorable Judge Stone Cold Steve Austin - From Dilbert Episode 30

      G W 2 Replies Last reply
      0
      • M Matt Newman

        Yeah i ran into this bug too, I think I solved it by posting the question in the correct forum. Matt Newman
        All rise for the honorable Judge Stone Cold Steve Austin - From Dilbert Episode 30

        G Offline
        G Offline
        group7
        wrote on last edited by
        #3

        Hi, I just join this web today, may I ask which forum I should post? Thanks. :)

        K H 2 Replies Last reply
        0
        • G group7

          Hi, I just join this web today, may I ask which forum I should post? Thanks. :)

          K Offline
          K Offline
          KevinMac
          wrote on last edited by
          #4

          The Visual C++ forum sounds like the right choice. The lounge is a great place so stick around and see what it is like. The soapbox is for using adult language and ranting but the rest of the forums have great content so explore. And welcome to the CP.

          1 Reply Last reply
          0
          • G group7

            Hi, I just join this web today, may I ask which forum I should post? Thanks. :)

            H Offline
            H Offline
            Heath Stewart
            wrote on last edited by
            #5

            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

            A 1 Reply Last reply
            0
            • H Heath Stewart

              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

              A Offline
              A Offline
              Antony M Kancidrowski
              wrote on last edited by
              #6

              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)

              W 1 Reply Last reply
              0
              • M Matt Newman

                Yeah i ran into this bug too, I think I solved it by posting the question in the correct forum. Matt Newman
                All rise for the honorable Judge Stone Cold Steve Austin - From Dilbert Episode 30

                W Offline
                W Offline
                Wackatronic
                wrote on last edited by
                #7

                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)[^]

                1 Reply Last reply
                0
                • A Antony M Kancidrowski

                  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)

                  W Offline
                  W Offline
                  Wackatronic
                  wrote on last edited by
                  #8

                  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)[^]

                  A 1 Reply Last reply
                  0
                  • W Wackatronic

                    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)[^]

                    A Offline
                    A Offline
                    Antony M Kancidrowski
                    wrote on last edited by
                    #9

                    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)

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups