Linked by David Adams on Tue 22nd Feb 2011 19:52 UTC, submitted by estherschindler
General Development Your company is ready to upgrade its custom applications from 32-bit to 64-bit. (Finally.) Here's 10 tips to help you make the transition as painless as possible.
Permalink for comment 463857
To read all comments associated with this story, please click here.
RE[4]: ?
by Valhalla on Thu 24th Feb 2011 18:18 UTC in reply to "RE[3]: ?"
Valhalla
Member since:
2006-01-24


The thing for application developers to watch for is imperfect casts. If an app calls "SendMessage( hWnd, blah, blah, (LONG)(mystruct *)foo);" then on Win32 this will work fine, but on Win64 will cause a subtle pointer truncation. if (LPARAM) were used instead of (LONG) things would be fine, but on Win32 those are the same type.

Yes, but again if you follow the API call structure you will be fine, in this case use LPARAM, WPARAM rather than what they happen to be defined as. Which is why it is important to never assume anything about API types since they can change 'behind the scenes' which can break your application if you 'assume' anything. When dealing with foreign code that you can't manipulate, simply stick to the interface provided or set yourself up for a potential ton of headache.

Reply Parent Score: 2