views:

60

answers:

2

When you have a LPCWSTR, why is it a Long Pointer? There's no Long in it's definition, as far as I know.

Can anybody explain?

+1  A: 

On 32-bit or greater machines, a long pointer is the same as any other pointer. The difference appears on machines with smaller native word sizes where you might have a 16-bit pointer and a 32-bit pointer type, for example. Usually they are called near and far pointers.

Carl Norum
+2  A: 

'Long' is a leftover from Windows-16-bit. In the old days, on DOS and Windows 3.x, most apps were 16 bits and had 16-bit pointers. 32-bit pointers were 'long' and had to be specially declared, and used (in some DOS cases) selectors and not the flat address space.

bmargulies