Gnuradio message passing

Message passing is described in web site. I do not know where to put
codes in
c++ sync blocks. Can you please explain how to implement message passing
with
example. Do we need for loop in work function. How to return
noutput_items.
Thanks
Neil
And another thing. How to remove inserted GRC cusome module from GRC.

Hi,

message passing is implemented asynchronously by binding functions to
message ports.
[1] is the page that explains message ports in great detail.
So first you declare your message ports preferably in your blocks
constructor.
Than you bind one of your functions to an incoming message port. The
functions parameter has to be a pmt::pmt_t.
Everytime a message is published to this port, this function will be
called.
For outgoing message ports, you just generate your pmt object and call
the
publish method.
Exact method names etc. are explained on the GNU Radio manual page.

happy hacking
Johannes

[1] http://gnuradio.org/doc/doxygen/page_msg_passing.html