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. Splitting a DWORD into 24 bit and 8 bit values....

Splitting a DWORD into 24 bit and 8 bit values....

Scheduled Pinned Locked Moved The Lounge
question
15 Posts 12 Posters 1 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.
  • 1 1 21 Gigawatts

    Pssst! 'Please do not post programming questions in the lounge' Have you tried the C forum? :)

    "If you can't explain it simply, you don't understand it well enough" ~ Albert Einstein "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." ~ Paul Neal "Red" Adair

    B Offline
    B Offline
    Ben Aldhouse
    wrote on last edited by
    #5

    Oh dear, it's too early in the morning for me to even get my forum protocol right. sorrry folks!

    1 Reply Last reply
    0
    • B Ben Aldhouse

      This should be pretty easy, right? I'm feeling pretty brain dead right now, though... In CTreeCtrl the nodes have a DWORD data item and I want to make use of that as a 24 bit value and an 8 bit value. What would be a nice way of getting and setting the DWORD from two other variables? Thanks, Ben.

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

      Please don't split into the wind! :rolleyes:

      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
      [My articles]

      In testa che avete, signor di Ceprano?

      R 1 Reply Last reply
      0
      • B Ben Aldhouse

        This should be pretty easy, right? I'm feeling pretty brain dead right now, though... In CTreeCtrl the nodes have a DWORD data item and I want to make use of that as a 24 bit value and an 8 bit value. What would be a nice way of getting and setting the DWORD from two other variables? Thanks, Ben.

        N Offline
        N Offline
        NormDroid
        wrote on last edited by
        #7

        And...

        Two heads are better than one.

        1 Reply Last reply
        0
        • B Ben Aldhouse

          This should be pretty easy, right? I'm feeling pretty brain dead right now, though... In CTreeCtrl the nodes have a DWORD data item and I want to make use of that as a 24 bit value and an 8 bit value. What would be a nice way of getting and setting the DWORD from two other variables? Thanks, Ben.

          M Offline
          M Offline
          moon_stick
          wrote on last edited by
          #8

          I know it's early but you should probably don a fireproof jacket - just in case...!! (Or maybe just post in the C++ forum)

          Sarchasm : The gulf between the author of sarcastic wit and the person who doesn't get it.

          1 Reply Last reply
          0
          • B Ben Aldhouse

            This should be pretty easy, right? I'm feeling pretty brain dead right now, though... In CTreeCtrl the nodes have a DWORD data item and I want to make use of that as a 24 bit value and an 8 bit value. What would be a nice way of getting and setting the DWORD from two other variables? Thanks, Ben.

            P Offline
            P Offline
            Pete OHanlon
            wrote on last edited by
            #9

            The problem you've got here is that you were trying to split the DWORD using a mouldy old leaf. You really need something like a bandsaw to split that DWORD neatly.

            I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

            Forgive your enemies - it messes with their heads

            My blog | My articles | MoXAML PowerToys | Onyx

            R 1 Reply Last reply
            0
            • B Ben Aldhouse

              This should be pretty easy, right? I'm feeling pretty brain dead right now, though... In CTreeCtrl the nodes have a DWORD data item and I want to make use of that as a 24 bit value and an 8 bit value. What would be a nice way of getting and setting the DWORD from two other variables? Thanks, Ben.

              P Offline
              P Offline
              peterchen
              wrote on last edited by
              #10

              As with questons on CP, you have to know where to put which bits.

              Agh! Reality! My Archnemesis![^]
              | FoldWithUs! | sighist | WhoIncludes - Analyzing C++ include file hierarchy

              1 Reply Last reply
              0
              • P Pete OHanlon

                The problem you've got here is that you were trying to split the DWORD using a mouldy old leaf. You really need something like a bandsaw to split that DWORD neatly.

                I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

                Forgive your enemies - it messes with their heads

                My blog | My articles | MoXAML PowerToys | Onyx

                R Offline
                R Offline
                Rage
                wrote on last edited by
                #11

                I have a routine in my lib that uses an axe. Can have some accuracy problems, but it splits anything it is given as parameters.

                1 Reply Last reply
                0
                • CPalliniC CPallini

                  Please don't split into the wind! :rolleyes:

                  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
                  [My articles]

                  R Offline
                  R Offline
                  Rajesh R Subramanian
                  wrote on last edited by
                  #12

                  :laugh:

                  There are some really weird people on this planet - MIM.

                  1 Reply Last reply
                  0
                  • D DaveAuld

                    Is this is a programming question? :~

                    Dave Please support my CPRepWatcher article in the August competition! Find Me On: Web|Facebook|Twitter|LinkedIn

                    R Offline
                    R Offline
                    Rajesh R Subramanian
                    wrote on last edited by
                    #13

                    It is.

                    There are some really weird people on this planet - MIM.

                    D 1 Reply Last reply
                    0
                    • R Rajesh R Subramanian

                      It is.

                      There are some really weird people on this planet - MIM.

                      D Offline
                      D Offline
                      DaveAuld
                      wrote on last edited by
                      #14

                      thought as much, i went and put on my flame proof overalls, as had a feeling it might get a bit warm around here. :)

                      Dave Please support my CPRepWatcher article in the August competition! Find Me On: Web|Facebook|Twitter|LinkedIn

                      1 Reply Last reply
                      0
                      • M Mark_Wallace

                        Pass all values to a CListCtrl...

                        I wanna be a eunuchs developer! Pass me a bread knife!

                        C Offline
                        C Offline
                        Chris Maunder
                        wrote on last edited by
                        #15

                        Beaten to the punchline again

                        cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP

                        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