Creating a simple windows messaging app



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


.



Relevant Pages

  • Re: Creating a simple windows messaging app
    ... a broker app that receives packets from a canbus and pushes them out to ... each application thread a copy of the packet. ... appThread responds to: ...
    (microsoft.public.vc.mfc)
  • Re: Creating a simple windows messaging app
    ... a broker app that receives packets from a canbus and pushes them out to multiple applications. ... the broker then takes the packet and then gives each application thread a copy of the packet. ... the main loop will then create a packet queue and spawns off a appthread. ...
    (microsoft.public.vc.mfc)
  • Re: Creating a simple windows messaging app
    ... a broker app that receives packets from a canbus and pushes them out to ... each application thread a copy of the packet. ... appThread responds to: ... consists of putting the message into a queue to be sent to the bus (no ...
    (microsoft.public.vc.mfc)
  • Re: Creating a simple windows messaging app
    ... a broker app that receives packets from a canbus and pushes them out to ... each application thread a copy of the packet. ... appThread responds to: ... consists of putting the message into a queue to be sent to the bus (no ...
    (microsoft.public.vc.mfc)
  • Re: Creating a simple windows messaging app
    ... a broker app that receives packets from a canbus and pushes them out to ... each application thread a copy of the packet. ... consists of putting the message into a queue to be sent to the bus (no ... targeted at a specific window. ...
    (microsoft.public.vc.mfc)

Loading