Re: How do MAKEINTRESOURCE in Euphoria?
- Posted by mattlewis (admin) May 17, 2013
- 2017 views
CoJaBo2 said...
mattlewis said...
This appears to be casting to a WORD (16-bit unsigned) and then up into a pointer, so you should be able to do:
function MAKEINTRESOURCE( atom x ) return and_bits( 0xffff, x ) end function
This isn't correct; the primary purpose of that is to do the typecast, so that Windows can store a 16-bit integer ID in a type defined as "pointer" for convoluted reasons; Eu doesn't have types, so in Eu this macro would be a complete no-op.
Euphoria's and_bits() also returns an unsigned value, so it's not necessarily a no-op, though I agree that it is if you're dealing with something that's already a valid value. In my code, I usually ignore this sort of macro for the purposes of euphoria.
Matt