Click here to Skip to main content
15,881,828 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Please can somebody explain the the meaning following expression found in MSDN?

In the description for INT_PTR , it says,"A signed integer type for pointer precision.Used when casting a pointer to an integer for pointer arithmetic."

What does it mean by " casting a pointer to integer for pointer arithmetic."Can anyone explain what this means with a line of code?


See related questions at:

http://www.codeproject.com/Questions/729747/Please-when-is-it-best-right-to-use-the-new-data-t

http://www.codeproject.com/Questions/729713/Can-the-following-code-run-on-64bit-system

The msdn page is located at:

http://msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx
Posted
Comments
Matt T Heffron 18-Feb-14 15:44pm    
Instead of posting this as a new question, you should have just used the "Improve question" on your question 1 minute earlier.
OriginalGriff 18-Feb-14 16:10pm    
I've deleted the earlier question, since this contains slightly more info...
Matt T Heffron 18-Feb-14 16:12pm    
Deleting is "above my pay grade" ;-)
OriginalGriff 18-Feb-14 16:25pm    
I have the Power Of Greyskull: spammers beware! :laugh:
Sergey Alexandrovich Kryukov 18-Feb-14 21:18pm    
You forgot to add "sinister" to "laugh"... :-)
—SA

1 solution

The "_PTR" types (like DWORD_PTR) are useful in APIs where the meaning of the value is user-defined. Several Windows APIs allow storing a user defined data value. This could be an integer or a pointer. Trying to store a 64 bit pointer in a 32 bit DWORD won't work. DWORD_PTR takes care of that.

Examples: ComboBox, ListBox, ListCtrl, TreeCtrl.

http://msdn.microsoft.com/en-us/library/43y9kx83.aspx
http://msdn.microsoft.com/en-us/library/287styts.aspx
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900