X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f Message-ID: <001501c197a0$49059a30$1400a8c0@alex> From: "Alex Oleynikov" To: "ROLAND" Cc: References: <20020107162429 DOT 55131 DOT qmail AT web9106 DOT mail DOT yahoo DOT com> Subject: Re: PMCOM Date: Mon, 7 Jan 2002 12:25:21 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Reply-To: djgpp AT delorie DOT com Roland wrote: > Could you give me some sort of example of how to do > this? I'm not sure on how to do this... > Here's a simple example of how to do this: typedef BOOL unsigned char typedef BYTE unsigned char #define TRUE 1 #define FALSE 0 #pragma check_stack (off) //IMPORTANT! Make sure to put this macro before the Rx handler function's definition void RxHandler (int Event) { BYTE CharRcvd; if( Event == evCOMRx ) { if( COMReadChar(COM1, (char *)&CharRcvd, 0) != 0) return; } else return; //Put your code here... return; } END_OF_FUNCTION(RxHandler); //IMPORTANT! Make sure to put these lines at the end of the function's definition #pragma check_stack () //Example of the com-port opening code BOOL OpenPort( void ) { if( COMPortOpen(COM1, 19200, 8, 'N', 1, 0, RxHandler) == 0 ) bPortOpen = TRUE; else bPortOpen = FALSE; return bPortOpen; } > Well, at some point a graphical window comes up (not > mine, because my program is text-based) with the > following error-message: > > The instruction at "0x0f00115e" referenced memory at > "0xffffffff". The memory could not be "read". > Looks like you're using Windows' DOS box. Sorry, I don't have experience working with this combination. Maybe PMCOM pulls some triggers here while trying to access COM-Ports, I don't know... > Maybe you could tell me if there's a new version of > PMCOM, which has some improvements over this version? > Yes, I've got PMCOM v1.1 with some extras in it (e.g. flow control is working). I also did some fixes on the library code, so if you don't mind using it I can send you the sources and debug release (this is what I'am currently using myself).