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. General Programming
  3. C / C++ / MFC
  4. anyone can help me to explain code below?

anyone can help me to explain code below?

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
8 Posts 5 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
    gentleguy
    wrote on last edited by
    #1

    dear all anyone can help me to explain code below? m_hbmp=m_vicImg.hBitmap; CStatic *pImgPicture=(CStatic*)GetDlgItem(IDC_staImg1); pImgPicture->SetBitmap(m_hbmp); i am not good in VC++, i know this is fundamental things. thanks a lot

    Li Zhiyuan

    T CPalliniC H 3 Replies Last reply
    0
    • G gentleguy

      dear all anyone can help me to explain code below? m_hbmp=m_vicImg.hBitmap; CStatic *pImgPicture=(CStatic*)GetDlgItem(IDC_staImg1); pImgPicture->SetBitmap(m_hbmp); i am not good in VC++, i know this is fundamental things. thanks a lot

      Li Zhiyuan

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      what don't you understand in this actually ? this is C code in Win32...

      [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

      C 1 Reply Last reply
      0
      • T toxcct

        what don't you understand in this actually ? this is C code in Win32...

        [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

        C Offline
        C Offline
        Cedric Moonen
        wrote on last edited by
        #3

        toxcct wrote:

        this is C code in Win32...

        Actually it's C++ code in MFC ;)

        Cédric Moonen Software developer
        Charting control [v1.3 - Updated]

        T 1 Reply Last reply
        0
        • C Cedric Moonen

          toxcct wrote:

          this is C code in Win32...

          Actually it's C++ code in MFC ;)

          Cédric Moonen Software developer
          Charting control [v1.3 - Updated]

          T Offline
          T Offline
          toxcct
          wrote on last edited by
          #4

          well there's nothing to see the difference here ^^

          [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

          C 1 Reply Last reply
          0
          • T toxcct

            well there's nothing to see the difference here ^^

            [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

            C Offline
            C Offline
            Cedric Moonen
            wrote on last edited by
            #5

            CStatic is a MFC class (WIN32 doesn't have wrapper classes). And C doesn't have classes neither. So CQFD :-D

            Cédric Moonen Software developer
            Charting control [v1.3 - Updated]

            T 1 Reply Last reply
            0
            • C Cedric Moonen

              CStatic is a MFC class (WIN32 doesn't have wrapper classes). And C doesn't have classes neither. So CQFD :-D

              Cédric Moonen Software developer
              Charting control [v1.3 - Updated]

              T Offline
              T Offline
              toxcct
              wrote on last edited by
              #6

              oops, i didn't watch further, and i only saw a pointer to a "user defined type"...lol CQFD :doh:

              [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

              1 Reply Last reply
              0
              • G gentleguy

                dear all anyone can help me to explain code below? m_hbmp=m_vicImg.hBitmap; CStatic *pImgPicture=(CStatic*)GetDlgItem(IDC_staImg1); pImgPicture->SetBitmap(m_hbmp); i am not good in VC++, i know this is fundamental things. thanks a lot

                Li Zhiyuan

                CPalliniC Offline
                CPalliniC Offline
                CPallini
                wrote on last edited by
                #7

                li zhiyuan wrote:

                m_hbmp=m_vicImg.hBitmap;

                Assigns to this object's (a CDialog derived class?) m_hbmp member (probably a HBITMAP, i.e. a Bitmap handle) the value of m_vicImg.hBitmap (i.e. the member hBitmap of the m_vicImg object (that you only know and probably is another member of this object).

                li zhiyuan wrote:

                CStatic *pImgPicture=(CStatic*)GetDlgItem(IDC_staImg1);

                Gets a pointer to a CStatic object representing the dialog static control having ID equal to IDC_staImg1.

                li zhiyuan wrote:

                pImgPicture->SetBitmap(m_hbmp);

                Calls the SetBitmap method of the CStatic object. This should change the bitmap represented by the dialog static control. BTW You can also get some information reading MSDN documentation. :)

                If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

                In testa che avete, signor di Ceprano?

                1 Reply Last reply
                0
                • G gentleguy

                  dear all anyone can help me to explain code below? m_hbmp=m_vicImg.hBitmap; CStatic *pImgPicture=(CStatic*)GetDlgItem(IDC_staImg1); pImgPicture->SetBitmap(m_hbmp); i am not good in VC++, i know this is fundamental things. thanks a lot

                  Li Zhiyuan

                  H Offline
                  H Offline
                  Hamid Taebi
                  wrote on last edited by
                  #8

                  You can declare a variable for static control instead make a pointer.

                  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