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