I was looking in MSDN to see what it says for the data types of the four arguments of a message. Expecting to see DWord, Long, Long, Long, instead I saw
So then I went to the MSDN page that lists data types:
http://msdn.microsoft.com/en-us/library/aa383751(VS.85).aspx
Each of the data types were listed as other data types which were listed as other data types ... the data trail looking like this:
hwnd --> handle --> pvoid no mention of 32 bit unsigned Int
uint --> unsign Int w/range of 4G (implies 32 bits)
wparam --> unit_ptr --> unsigned Int (doesn't say range or bits)
lparam --> long_ptr --> long signed long (long is not on the list)
That was pretty unsatisfying in that it never quite said what I expected. I certainly didn't expect lparam to be different.
I checked with Support and they said:
And in the Help topic on CB I found
Also, in most of the non-MSDN documentation I read, all Long's are typically used!
Even in the distributed PowerBASIC applications I see a mixture of DWord and Long for handles.
My plan is to stick with the DWord-Long-Long-Long.
Are there any words of wisdom on this?
Code:
LRESULT CALLBACK WindowProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
http://msdn.microsoft.com/en-us/library/aa383751(VS.85).aspx
Each of the data types were listed as other data types which were listed as other data types ... the data trail looking like this:
hwnd --> handle --> pvoid no mention of 32 bit unsigned Int
uint --> unsign Int w/range of 4G (implies 32 bits)
wparam --> unit_ptr --> unsigned Int (doesn't say range or bits)
lparam --> long_ptr --> long signed long (long is not on the list)
That was pretty unsatisfying in that it never quite said what I expected. I certainly didn't expect lparam to be different.
I checked with Support and they said:
...they use HWND which is a unsigned 32-bit integer, which is the same as a DWord. We recommend a DWord because Windows returns a window handle as a DWord and if this is converted to a Long integer it could result in a negative value. This is probably not a problem because if you ever use this Long Integer negative value with any command that wants a DWord it will be converted to a DWord and become positive again.
Code:
The implied parameters are: FUNCTION DlgCallback(BYVAL hDlg AS DWORD _ BYVAL wMsg AS LONG _ BYVAL wParam AS LONG _ BYVAL lParam AS LONG)
Even in the distributed PowerBASIC applications I see a mixture of DWord and Long for handles.
My plan is to stick with the DWord-Long-Long-Long.
Are there any words of wisdom on this?
Comment