Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Don Higgins
  Where is Don Higgins?
 Peoria
 Illinois - United States
 Don Higgins
 To: Richard Clarke
  Where is Richard Clarke?
 Crowcombe
 United Kingdom
 Richard Clarke
 Tags
Subject: RE: mscomm error control
Thread ID: 155297 Message ID: 155318 # Views: 3 # Ratings: 0
Version: Visual FoxPro 9 Category: Errors & Debugging
Date: Saturday, December 29, 2007 10:09:47 PM         
   


> Don,
>
> Sorry my mistake!
>
>
> in the error method on the form check to see if the error number is 1429 or 1426 (OLE errors). You can then use aerror() to get the error number from the control. Element 7 gives you the OLE errror number.
>
>
> Sorry about the earlier error - still in Christmas mode!
>
>
> Regards
>
>
>
> Richard Clarke


Here is what I have now, I think it was from someone on the board that I was able to search on. Weird thing is it bypasses this Error Event and goes VFP Error still.

Lparameters nError, cMethod, nLine

If Inlist(nError, 1429, 1426)
	Local aErrArray(1)
	Aerror(aErrArray)
	If [INVALID PORT NUMBER] $ Upper(aErrArray(3)) Or ;
			[UNKNOWN OLE STATUS CODE] $ Upper(aErrArray(3))
		glBadPort = .T.
	Endif
Else
	Messagebox([Error #: ] + Allt(Str(nError)) + Chr(13) + ;
		[Message: ] + Message() + Chr(13) + ;
		[Line with error: ] + Allt(Str(nLine)) + Chr(13) + ;
		[Method: ] + cMethod)
Endif




Don Higgins






ENTIRE THREAD

mscomm error control Posted by Don Higgins @ 12/29/2007 9:20:59 AM
RE: mscomm error control Posted by Richard Clarke @ 12/29/2007 7:04:48 PM
RE: mscomm error control Posted by Don Higgins @ 12/29/2007 8:38:57 PM
RE: mscomm error control Posted by Richard Clarke @ 12/29/2007 9:01:39 PM
RE: mscomm error control Posted by Don Higgins @ 12/29/2007 10:09:47 PM
RE: mscomm error control Posted by Richard Clarke @ 12/31/2007 3:13:47 PM