Issue with RegQueryValueEx
<p>I am using RegQueryValueEx to read a String value (REG_SZ) from  the registry.
The value if this registry contains some Japanese Characters along with english.<br>
For eg:  C:\Program Files\MyReg\ﾁﾁﾁ\helloworld</p>

<p>I am using the following code snippet:</p>

<pre><code>BYTE* dwValue = 0;
DWORD  dwSize = 0;
DWORD dwType = SZ_REG;
TCHAR* valueName= TEXT("test");
//Get the size 
if(RegQueryValueEx(hKey, valueName,NULL,&amp;dwType,NULL,&amp;dwSize) == ERROR_SUCCESS)
{   
dwValue = new BYTE[dwSize];

if(RegQueryValueEx(hKey, valueName,NULL,&amp;dwType,( BYTE* )( dwValue ),&amp;dwSize) == ERROR_SUCCESS ) )
   _tprintf(TEXT("The value is  %s"),(TCHAR*)dwValue);
}  
</code></pre>

<p>The output i get is-</p>

<p>The value is C:\Program Files\MyReg\</p>

<p>This exe is console application and has got  UNICODE preprocessor defined.
If i remove it then it works correctly and gives the correct string.
I am not sure whats going wrong due to UNICODE.</p>

<p>-Thanks</p>
