Boost logo

Boost Users :

Subject: [Boost-users] Boost:Signals and Bind question
From: mararual (marcos.aruj_at_[hidden])
Date: 2009-02-02 18:45:43


Hi Everyone,

I have a question on using Signals with a COM server and a client.

Is it possible to have a signal on a COM server and a method
ConnectSlot(clientMethod) that can be called from a client?

I want to have a COM server that when some update is done, notifies all of
the slots(subscribers), so that from the clients I can do:

helloService->ConnectSlot(boost::bind(&Callback));

where callback is a method in the client.

On the server side I have:

STDMETHODIMP CHelloService::ConnectSlot(VARIANT aSubscriber)
{
        connect(aSubscriber);
        //connect(boost::bind(aSubscriber));
        return S_OK;
}

CHelloService::connection_t
CHelloService::connect(signal_t::slot_function_type subscriber)
{
    return m_sig.connect(subscriber);
}

Don't know how to receive the result of Boost::bind from the client.

I read Bind supports COM by adding #define BOOST_MEM_FN_ENABLE_STDCALL
before the include of bind.hpp.

What would you recommend for this approach? Any examples?

Thanks in advance,

Marcos

-- 
View this message in context: http://www.nabble.com/Boost%3ASignals-and-Bind-question-tp21800004p21800004.html
Sent from the Boost - Users mailing list archive at Nabble.com.

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net