mscomm1.commEvent read locks the mouse 
Author Message
 mscomm1.commEvent read locks the mouse

Hello,

     I am using the mscomm control in VB 5.0, and I found out that a
read of the commEvent property causes the mouse to lock up, although
things continue to work normally.

     I traced through the code and made sure the comm port's values were
set (19200,n,8,1), and that it was open.  I use 3 of the 4 comm ports on
my system (2 via dll's, one for mscomm, and the fourth is a serial
mouse.)

     I stepped through the code, and found out that the mouse locks when
I step through the statement that reads the comm event type.  I read it
(setting an integer variable to it) as the first thing in my OnComm
event (sub MSComm1_OnComm).  At that point, the mouse locks, though the
system keeps running (I can even continue to step through the code using
the keyboard.)

     The comm event is 2, or comEvReceive.  My comm port is comm 1, and
I have set RThreshold to 1 in my initialization function.  Actually,
something even more bizarre is happening.  I created a new variable just
before the commEvent property read, and set it to mscomm1.PortOpen to
confirm that the port was open.  When I stepped over that one, it
locked.

     I am at a loss, and don't know what to do.  Are there any known
problems with setting RThreshold to anything but zero?  What if you
don't read a buffer?  I am still investigating whether one of my dll's
is wrongly accessing either this mscomm's port (1) or the mouse's port
(3), but I doubt it.

     Any ideas will be greatly appreciated.



Fri, 01 Dec 2000 03:00:00 GMT  
 mscomm1.commEvent read locks the mouse

Hello,

     I am using the mscomm control in VB 5.0, and I found out that a
read of the commEvent property causes the mouse to lock up, although
things continue to work normally.

     I traced through the code and made sure the comm port's values were
set (19200,n,8,1), and that it was open.  I use 3 of the 4 comm ports on
my system (2 via dll's, one for mscomm, and the fourth is a serial
mouse.)

     I stepped through the code, and found out that the mouse locks when
I step through the statement that reads the comm event type.  I read it
(setting an integer variable to it) as the first thing in my OnComm
event (sub MSComm1_OnComm).  At that point, the mouse locks, though the
system keeps running (I can even continue to step through the code using
the keyboard.)

     The comm event is 2, or comEvReceive.  My comm port is comm 1, and
I have set RThreshold to 1 in my initialization function.  Actually,
something even more bizarre is happening.  I created a new variable just
before the commEvent property read, and set it to mscomm1.PortOpen to
confirm that the port was open.  When I stepped over that one, it
locked.

     I am at a loss, and don't know what to do.  Are there any known
problems with setting RThreshold to anything but zero?  What if you
don't read a buffer?  I am still investigating whether one of my dll's
is wrongly accessing either this mscomm's port (1) or the mouse's port
(3), but I doubt it.

     Any ideas will be greatly appreciated.



Fri, 01 Dec 2000 03:00:00 GMT  
 mscomm1.commEvent read locks the mouse

Hi Kevin,

Do each of the comports have independent IRQs?  This is necessary.  I
suspect that your mouse serial port uses the same IRQ as the one that is
giving you trouble.

I have a system with four comports (serial mouse on Com1), with no trouble.

Take a look at my book (see below) for more detailed information.

--
Richard Grier
Hard & Software
12962 West Louisiana Avenue
Lakewood, CO  80228
303-986-2179 (voice)
303-986-3143 (fax)
Author of Visual Basic Programmer's Guide to Serial Communications.
For information, look on my homepage at
http://ourworld.compuserve.com/homepages/richard_grier.
Use the Books link to order from Amazon.com.  For faster service, contact
the publisher at http://www.mabry.com.



Fri, 01 Dec 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Mouse Change/Mouse-Keyboard Lock

2. CommEvent howto??

3. CommEvent Usage

4. mscomm & CommEvent

5. CommEvent "EOF", can I disable it?

6. MSComm.CommEvent

7. MSComm.CommEvent

8. CommEvent problem

9. Lock keyboard and mouse?

10. Lock Keyboard and mouse

11. Locking Keyboard/Mouse

12. VBDOS (Std): Mouse lock up

 

 
Powered by phpBB® Forum Software