Re: DirectPlay should convert dwReserved1/2 registry keys from strings to DWORDs
if( i == 0 ) - memcpy( &lpSpData->dwReserved1, returnBuffer, sizeof(lpSpData->dwReserved1) ); + sscanf(returnBuffer, "%x", &lpSpData->dwReserved1); Couldnt you use: strcpy(lpSpData->dwReserved1,returnBuffer); Sorry for only replying now; Your solution is equivalent, except that it is looks more complicated regards, Joris --------------------------------- The fish are biting. Get more visitors on your site using Yahoo! Search Marketing.
On 03.03.2007 13:56, Joris Huizer wrote:
if( i == 0 ) - memcpy( &lpSpData->dwReserved1, returnBuffer, sizeof(lpSpData->dwReserved1) ); + sscanf(returnBuffer, "%x", &lpSpData->dwReserved1);
Couldnt you use: strcpy(lpSpData->dwReserved1,returnBuffer);
Reading a string and interpreting it as a hex value, this value then being stored in a DWORD, is not quite the same as copying the string into the memory occupied by the DWORD. -f.r.
--- Frank Richter <frank.richter(a)gmail.com> wrote:
On 03.03.2007 13:56, Joris Huizer wrote:
if( i == 0 ) - memcpy( &lpSpData->dwReserved1,
returnBuffer,
sizeof(lpSpData->dwReserved1) ); + sscanf(returnBuffer, "%x",
&lpSpData->dwReserved1);
Couldnt you use: strcpy(lpSpData->dwReserved1,returnBuffer);
Reading a string and interpreting it as a hex value, this value then being stored in a DWORD, is not quite the same as copying the string into the memory occupied by the DWORD.
-f.r.
Ow I'm sorry, then I mis-interpreted what was happening- sorry for that ____________________________________________________________________________________ Looking for earth-friendly autos? Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center. http://autos.yahoo.com/green_center/
participants (2)
-
Frank Richter -
Joris Huizer