Title: [msvc] Communications & Windows Messages

Apologies if this seems OT for MSVC, but the "Windows message" part affects
VC programs as well.

In order for incoming communications to succeed, certain Windows messages
need to be allowed to pass through the message pump. If you don't allow
those messages, no inbound comms. But does anyone know what those messages
are these days? It used to be WM_COMMS or WM_COMMSNOTIFY (I think), but they
no longer exist. I tried using Spy++ on a VB program, but that didn't help
identify the message.

You see, I have a situation where a VB program is going to be communicating
in the background regularly, but I'm in a catch-22 situation... I have to
allow messages to enable incoming comms (trust me I tried not letting
anything except WM_PAINT through, comms failed), but that means that the
user can click a button and start some other communication (this program is
all about communicating live with some hardware), which can confuse the
comms since a second message gets started while the first is still waiting
for an answer.

Normally one would disable the UI during the comms to prevent this; but
because the comms are so frequent and in the background (checking status and
so on), this is not going to be good since you would end up with a twitchy
UI constantly enabling / disabling - this wouldn't look good. So the only
alternative is to process ONLY paint and comms messages while waiting for an
answer - mouse and keyboard messages remain in the queue. If only I knew
what messages to allow through!

I had already tried having the VB code use a VC-written DLL for the comms,
but curiously this was in the order of 5 times SLOWER than using
MSCOMM32.OCX directly in the VB program. Alarming, really.

(If anyone is thinking of poo-pooing VB as a language, don't bother.)

--
Jason Teagle
[EMAIL PROTECTED]

Reply via email to