Where I can learn about using wsprintf?
-
Where I can learn about using wsprintf? I using Visual Studio 12 with plain C Code Lines. For examples, this lines give me 2 different results depending on the formatting I believe but I can't find any practical info about it. For example what the " >>6" or " >>12" do? Thanks, check the code below and you see what I mean DWORD DVALE=19542016; wsprintf(BUFF, "Version is %d \n Good Night",DVALE >>6 & 0xff); MessageBox(hWndMain,BUFF,"The Value",MB_OK); // Display 192 wsprintf(BUFF, "Version is %d \n Good Night",DVALE >> 12 & 0xff); MessageBox(hWndMain,BUFF,"The Value",MB_OK); // Display 163
-
Where I can learn about using wsprintf? I using Visual Studio 12 with plain C Code Lines. For examples, this lines give me 2 different results depending on the formatting I believe but I can't find any practical info about it. For example what the " >>6" or " >>12" do? Thanks, check the code below and you see what I mean DWORD DVALE=19542016; wsprintf(BUFF, "Version is %d \n Good Night",DVALE >>6 & 0xff); MessageBox(hWndMain,BUFF,"The Value",MB_OK); // Display 192 wsprintf(BUFF, "Version is %d \n Good Night",DVALE >> 12 & 0xff); MessageBox(hWndMain,BUFF,"The Value",MB_OK); // Display 163
1. Did you try to pass the L"Version is %d \n Good Night" rather than "Version is %d \n Good Night"? 2. " >>6" or " >>12" just do what they must do according to the https://msdn.microsoft.com/en-us/library/336xbhcz.aspx?f=255&MSPPError=-2147217396
-
Where I can learn about using wsprintf? I using Visual Studio 12 with plain C Code Lines. For examples, this lines give me 2 different results depending on the formatting I believe but I can't find any practical info about it. For example what the " >>6" or " >>12" do? Thanks, check the code below and you see what I mean DWORD DVALE=19542016; wsprintf(BUFF, "Version is %d \n Good Night",DVALE >>6 & 0xff); MessageBox(hWndMain,BUFF,"The Value",MB_OK); // Display 192 wsprintf(BUFF, "Version is %d \n Good Night",DVALE >> 12 & 0xff); MessageBox(hWndMain,BUFF,"The Value",MB_OK); // Display 163
The greater-than signs are shift operators (https://msdn.microsoft.com/en-us/library/336xbhcz.aspx?f=255&MSPPError=-2147217396). The result is then truncated using a bitwise and operator (Bitwise AND Operator: &[^])
-
The greater-than signs are shift operators (https://msdn.microsoft.com/en-us/library/336xbhcz.aspx?f=255&MSPPError=-2147217396). The result is then truncated using a bitwise and operator (Bitwise AND Operator: &[^])
Auch, you think I can remember those days? That's a lot of math, if I start experimenting I may get it back. But for now, that page got me hungry!!! But I did catch the idea of shifting, all this because a code that I posted here, that some one tested and said works correctly and got the right values, however I don't, I do not see how may code works correctly on his computer, but on mine I get big numbers, far for what I am looking for. Go ahead and check it, and tell me what you think if you please.... Thanks Look for "No-Errors-but-wrong-values-on-return"
-
Auch, you think I can remember those days? That's a lot of math, if I start experimenting I may get it back. But for now, that page got me hungry!!! But I did catch the idea of shifting, all this because a code that I posted here, that some one tested and said works correctly and got the right values, however I don't, I do not see how may code works correctly on his computer, but on mine I get big numbers, far for what I am looking for. Go ahead and check it, and tell me what you think if you please.... Thanks Look for "No-Errors-but-wrong-values-on-return"
Sorry, I can't diagnose what happens on your computer. (And whatever you are doing elsewhere is pointless and bad practice. Errors in your code have been identified. Just check the windows version and end it there. To clarify: DON'T check the versions of system DLLs. There are multiple versions of many DLLs and you have no idea which DLL is actually being used.)
-
Where I can learn about using wsprintf? I using Visual Studio 12 with plain C Code Lines. For examples, this lines give me 2 different results depending on the formatting I believe but I can't find any practical info about it. For example what the " >>6" or " >>12" do? Thanks, check the code below and you see what I mean DWORD DVALE=19542016; wsprintf(BUFF, "Version is %d \n Good Night",DVALE >>6 & 0xff); MessageBox(hWndMain,BUFF,"The Value",MB_OK); // Display 192 wsprintf(BUFF, "Version is %d \n Good Night",DVALE >> 12 & 0xff); MessageBox(hWndMain,BUFF,"The Value",MB_OK); // Display 163
-
Sorry, I can't diagnose what happens on your computer. (And whatever you are doing elsewhere is pointless and bad practice. Errors in your code have been identified. Just check the windows version and end it there. To clarify: DON'T check the versions of system DLLs. There are multiple versions of many DLLs and you have no idea which DLL is actually being used.)
-
The greater-than signs are shift operators (https://msdn.microsoft.com/en-us/library/336xbhcz.aspx?f=255&MSPPError=-2147217396). The result is then truncated using a bitwise and operator (Bitwise AND Operator: &[^])