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. _chdrive unicode support.

_chdrive unicode support.

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
6 Posts 3 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.
  • R Offline
    R Offline
    Rakesh5
    wrote on last edited by
    #1

    Hi Guys, Do we have any unicode equivalent to this _chdrive function? I made my application unicode supporting one. previously it was working fine but now it is not working and application is crashing. Previously it was having the value of 28 but now the value is 35. Why is it so? code snippet: ---------------------- _chdrive(theApp.m_Dir[0]-'A'+1); ------------------------------------------------- can anyone shed some light on this issue? Thanks, Rakesh.

    C 1 Reply Last reply
    0
    • R Rakesh5

      Hi Guys, Do we have any unicode equivalent to this _chdrive function? I made my application unicode supporting one. previously it was working fine but now it is not working and application is crashing. Previously it was having the value of 28 but now the value is 35. Why is it so? code snippet: ---------------------- _chdrive(theApp.m_Dir[0]-'A'+1); ------------------------------------------------- can anyone shed some light on this issue? Thanks, Rakesh.

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

      Rakesh5 wrote:

      Do we have any unicode equivalent to this _chdrive function?

      _chdrive is completely independent of UNICODE, since it accepts an integer as argument (and not a string).

      Rakesh5 wrote:

      Previously it was having the value of 28 but now the value is 35.

      Which value are you talking about ? The return value of _chdrive ? That's impossible since it returns either 0 or 1. Please clarify your question...

      Cédric Moonen Software developer
      Charting control [v2.0] OpenGL game tutorial in C++

      R 1 Reply Last reply
      0
      • C Cedric Moonen

        Rakesh5 wrote:

        Do we have any unicode equivalent to this _chdrive function?

        _chdrive is completely independent of UNICODE, since it accepts an integer as argument (and not a string).

        Rakesh5 wrote:

        Previously it was having the value of 28 but now the value is 35.

        Which value are you talking about ? The return value of _chdrive ? That's impossible since it returns either 0 or 1. Please clarify your question...

        Cédric Moonen Software developer
        Charting control [v2.0] OpenGL game tutorial in C++

        R Offline
        R Offline
        Rakesh5
        wrote on last edited by
        #3

        Hi,thanks for the reply... int a = theApp.m_Dir[0]-'A'+1 ; Can you please tell me what is the logic behind using 'A' + 1 ; Can you help me?? Thanks, Rakesh.

        C 1 Reply Last reply
        0
        • R Rakesh5

          Hi,thanks for the reply... int a = theApp.m_Dir[0]-'A'+1 ; Can you please tell me what is the logic behind using 'A' + 1 ; Can you help me?? Thanks, Rakesh.

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

          Rakesh5 wrote:

          Can you please tell me what is the logic behind using 'A' + 1 ;

          :doh: You wrote the code but you don't understand what you wrote ?? Anyway, you are taking the first letter of the m_Dir string (which is probably a drive letter) and substracting the value of 'A'. This is because the letter 'A' has a specific ASCII code (which is not 1) but the A drive should be 1. Then you are incrementing the drive number by 1.

          Cédric Moonen Software developer
          Charting control [v2.0] OpenGL game tutorial in C++

          R 1 Reply Last reply
          0
          • C Cedric Moonen

            Rakesh5 wrote:

            Can you please tell me what is the logic behind using 'A' + 1 ;

            :doh: You wrote the code but you don't understand what you wrote ?? Anyway, you are taking the first letter of the m_Dir string (which is probably a drive letter) and substracting the value of 'A'. This is because the letter 'A' has a specific ASCII code (which is not 1) but the A drive should be 1. Then you are incrementing the drive number by 1.

            Cédric Moonen Software developer
            Charting control [v2.0] OpenGL game tutorial in C++

            R Offline
            R Offline
            Rakesh5
            wrote on last edited by
            #5

            actually i did not write the code..my seniors have written.. am trying to learn what they have used .. anyway thanks alot for your help... rakesh.

            D 1 Reply Last reply
            0
            • R Rakesh5

              actually i did not write the code..my seniors have written.. am trying to learn what they have used .. anyway thanks alot for your help... rakesh.

              D Offline
              D Offline
              David Crow
              wrote on last edited by
              #6

              Rakesh5 wrote:

              actually i did not write the code..my seniors have written.. am trying to learn what they have used ..

              So use the debugger to see what the value of a is.

              "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

              "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

              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