Quote Originally Posted by Ecniv
BTW - long or bolean won't matter. if it fails it will be 0 in either case. It only matters with the handle being returned
It won't return a handle it only returns TRUE or FALSE. However TRUE is cast as 1 in the APIs not -1 as in VB. However VB will convert that for you. There is another difference and that is that the BOOL datatype is a 32bit integer (a VB long) while a VB boolean is a 16-bit integer.

However don't check the last error unless the function returns false.