Creating a simple windows messaging app
- From: "Nick Schultz" <nick.schultz@xxxxxxxx>
- Date: Thu, 10 Jul 2008 13:20:19 -0700
Hi there,
a broker app that receives packets from a canbus and pushes them out to
multiple applications.
there are two types of threads the broker will have: the main loop and the
"app" thread
The broker has a main loop that essentially sits and waits for two types of
messages:
-wm_canlib :
canlib notifies the broker by sending a wm_canlib message to a window
handle that I assign. the broker then takes the packet and then gives each
application thread a copy of the packet.
-(userdefined appregister) :
front end applications that want to receieve packets will broadcast this
message to get setup for receiving packets.
the main loop will then create a packet queue and spawns off a
appthread.
appThread responds to :
-WM_COPYDATA: (Sent from clientApp)
takes a packet sent from client app and sends it off on the bus
-QUEUE_READY: (Sent from mainloop)
gets notified from mainloop that it just put something in its queue.
the appthread will then empty the queue's contents, apply any filters on it,
and then send the packet off to its frontend app its responsible for.
so is there a good model to implement this scheme? there's only going to be
one main loop, and multiple appthreads (one for each registering app) each
thread is going to be needing the ability to send and receive windows
messages, including wm_copydata. How do I create the appthreads so that it
can send/receive messages?
I initially wanted to have all of this in the backgournd (invisible) however
I now think its a good idea to at least have a small window indicating that
the backend is on and that the user can start up their front end
applications. I can also have the ability to display raw data packets as
well.
Thanks,
Nick
.
- Follow-Ups:
- Re: Creating a simple windows messaging app
- From: Scott McPhillips [MVP]
- Re: Creating a simple windows messaging app
- Prev by Date: Re: vc++ mfc project build is extremely slow taking hours
- Next by Date: Re: How can I can the WM_VSCROLL event?
- Previous by thread: Re: vc++ mfc project build is extremely slow taking hours
- Next by thread: Re: Creating a simple windows messaging app
- Index(es):
Relevant Pages
|
Loading