I think a forum message is better suited to answer to your post.
I have done now a search in my largest VO project for all occurrences of _cast and found only 1.649 of them <g>.
Most of them are in the VO Class libraries code and in the bBrowser, and the others in code to enhances ListViews or interface to MAPI, and some of them adress the return value of PCALL().
Personally, I would mark all casts with usuals as errors, so we should look at them and correct the code.
IMHO it is better to fix code than to have some code that don't works and we don't know why.
Casts to typed values, and specially to value types are relatively safe. Casts to typed reference values are to check because in .NET they could give undesired (or wrong) results.
These are a few samples how _cast is used in my code:
Code: Select all
MAPILogon( dword( _cast, HWND_DESKTOP ), null_ptr, null_ptr, 0, 0, @nSession )
Code: Select all
sMAPI.pFreeBuffer := GetProcAddress( hLib , PSZ( _CAST , "MAPIFreeBuffer" ) )
Code: Select all
MemFree( PTR ( _CAST, pszCaption ) )
Code: Select all
SendMessage( self:Handle(), CB_GETITEMHEIGHT, Word( _Cast, -1 ), 20 )
Code: Select all
ListView_SetItem(hHandle, LONG(_CAST, strucItem))
Wolfgang