Jump to content

  • Log In with Google      Sign In   
  • Create Account


char/short/int/long/void* and WPARAM/LPARAM/HANDLE on win64


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 fir   Members   -  Reputation: -452

Like
0Likes
Like

Posted 21 March 2014 - 12:43 PM

This is basic but really idont know

 

I assume on win32 

char is 8bit, short is 16 int is 32 long is 32 too, 

HANDLE (HWND, HDC) is same as void* (32 bit)

LPARAM/WPARAM i really donk know - ?

(some other win32 typew worth knowing the size?)

 

Is thislike that? How it looks on win64? (I mean x64  winapi)



Sponsor:

#2 Álvaro   Crossbones+   -  Reputation: 12807

Like
1Likes
Like

Posted 21 March 2014 - 01:50 PM

You can write a tiny program that uses sizeof() to tell you how big any of those things are.



#3 fir   Members   -  Reputation: -452

Like
0Likes
Like

Posted 21 March 2014 - 03:02 PM

You can write a tiny program that uses sizeof() to tell you how big any of those things are.

I got no x64 windows (x64 proc but x32 win xp)



#4 kubera   Members   -  Reputation: 902

Like
0Likes
Like

Posted 11 April 2014 - 12:53 AM

HWND a;
HDC b;
WPARAM c;
LPARAM d;
static_assert(sizeof(a) == 8, "Bad");
static_assert(sizeof(b) == 8, "Bad");
static_assert(sizeof(c) == 8, "Bad");
static_assert(sizeof(d) == 8, "Bad");

short, etc have the same size on all Windows platforms.

There are types like ULONG_PTR, that are different on various platforms.

Handles have different sizes too.

Maybe you would have a possibility to test your app on X64 platform.

It would have bugs, because of the difference.


Edited by kubera, 11 April 2014 - 01:09 AM.


#5 Rattrap   Members   -  Reputation: 1598

Like
0Likes
Like

Posted 11 April 2014 - 07:11 AM

MSDN - Window Data Types

 

These are how Microsoft defines types in the Windows headers.  They are well defined in the scope of Windows.  Most of the types wont change in size, but ones that are intended to store pointers can change in size based on the target platform.

 

Note that target platform is not the same as target processor.  You can run a 32-bit application in a 64-bit environment.  Since it was compiled for a 32-bit target, values like LPARAM will be 32-bits.  If it is targeted for a 64-bit platform, types like LPARAM will expand to a 64-bit value.  Look at the link I provided above, it should tell you which ones do this.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS