On Tue, Feb 16, 2010 at 4:43 PM, Kyley Harris <ky...@harrissoftware.com> wrote: > I'll add my cents.. > under Delphi 7, getlasterror returns error 1413 as Karl said.. under Delphi > 2007 no errors whatsoever. whats clear is that Getlasterror is unlreliable > in this situation as Microsoft says, because microsoft online help says the > getlasterror value cannot be controlled depending on OS and device and only > the -1 is reliable as an answer.
Except that -1 isn't reliable because, as already discussed, it could be a valid data value. I would in fact expect the code returned to vary by OS and device (and that's what RaiseLastOSError is for) but I really didn't expect there to be an OS or device on which an LB_GETITEMDATA request out of the range of the listbox wasn't an error! Evidently I'm too trusting or something. Under the circumstances, checking the bounds first seems necessary. Cheers, Karl _______________________________________________ NZ Borland Developers Group - Delphi mailing list Post: delphi@delphi.org.nz Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: unsubscribe