Re: NT service and connection points



A callback interface is an interface you specify in your server
but do not implement. Connection points are just a standard
mechanism of passing [multiple] callback interfaces (called
source interfaces in this context) to the object with multicast
semantics.

A simple method for passing a single unicast callback interface
pointer to an object is:

HRESULT registerCallback([in] ICallback* pCallback);

The object accepts the callback, AddRef-s it and stores it
internally, then calls it when needed. To revoke the callback
pass NULL interface pointer to the same method.

BTW, your news client seems not to obey followup-to headers.
I removed the networking group explicitly.

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@xxxxxxxx
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================

"MON205" <MON205@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:67B1A244-FD2A-470D-A25B-2F0591280E13@xxxxxxxxxxxxxxxx
Thanks.
But I'm not an expert in Inter Process Connections. So, what is a
"callback
interface"? Can I send parameters using it?

"Alexander Nickolov" wrote:

And what is the problem with using events to your GUI
application? You may want to structure it using a callback
interface instead of using connection points though, since
the latter may not have the correct semantics for you.

My point is, always have the application connect to your
service. Don't try to create objects in your application
from within your service. Your GUI application must
always be in control, not your service.

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@xxxxxxxx
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================

"MON205" <MON205@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:9DC51BFD-F6B0-480F-92AC-DED45C4C58B9@xxxxxxxxxxxxxxxx
Thanks for reply.
I meant that I want the service send commands to the GUI.
.....
"Alexander Nickolov" wrote:

The correct group is:

microsoft.public.vc.atl

I set the followup to go to that group, so check for replies there.

How do you "reverse the behavior"? Why do you need to do that?

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@xxxxxxxx
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================

"MON205" <MON205@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:46F32526-6B5B-4670-B9EA-254EDC1C585F@xxxxxxxxxxxxxxxx
Hello all,

I have an NT Service which should communicate with a desktop MFC
application. To do this communication, I used an ATL/COM server
(EXE)
with
a
simple ATL object that has an interface with connection points.
When the desktop application implements the IDispatch interface to
listen
to connection point calls, and the NT service calls the application
via
connection points; the communication run successfully. But when I
reverse
the
behavior and let the service implements the IDispatch interface and
let
the
desktop application call the service; the connection hangs in the
Fire_XXX
event.

May be this is not the suitable forum for ATL issues, but I didn't
find
a
suitable one.
can any one help please.








.



Relevant Pages

  • Re: Problem with imported callback to C#
    ... Usually it happens when callback declaration is using non-standard ... exposes interface, which enables to set a callback, which is called ... DirectShow graph with mentioned face detector filter and calls its ... int BufferCB; ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: NT service and connection points
    ... Microsoft MVP, MCSD ... "Alexander Nickolov" wrote: ... interface instead of using connection points though, ... simple ATL object that has an interface with connection points. ...
    (microsoft.public.win32.programmer.networks)
  • Re: Function pointers (Callback functions) in Java ?
    ... object to a local var called 'callback'. ... > In the above I don't see the Opps interface. ... The code was a very simple example of creating a named inner class ... Its may be worth knowing that you can create anonymous inner classes ...
    (comp.lang.java.programmer)
  • Re: Callback Interface functions NOT being Called
    ... a callback interface interface ICallbackInterface which implements the ... callback functions of the buttons I create in Ribbon interface. ... The ribbon callbacks use IDispatch, always, so you must return ... You need COM_INTERFACE_ENTRY2(IDispatch, ICallbackInterface) ...
    (microsoft.public.office.developer.com.add_ins)
  • Re: Using .NET callback via COM
    ... possible solution is to "redefine" the interface as a managed __interface and ... > I can implement this interface in an unmanaged class and pass this ... The callback occurs successfully. ... > managed class as a member, how do I let my managed class know when the ...
    (microsoft.public.dotnet.framework.interop)