Customizing events on per-client basis (using connection points) 
Author Message
 Customizing events on per-client basis (using connection points)

Ah, very simple - don't use connection points - they are specifically
designed not to support distiction between clients. Define your own
callback mechanism, for example pass the callback interface pointer
when specifying the ROI as another parameter:

SetImageROI(xOffset,yOffset,width,height,pCallback,AdviseCookie)

Where pCallback is a pointer to the client's sink implementing the
callback interface.

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.*-*-*.com/
=====================================


Quote:
> Has anyone found a way, using connection points, to customize what an
event's
> data will be depending on who the client is?  I thought about using the
Advise
> cookie, and then the parameters that determine the event's data (set by
the
> client(s)) will get set through functions that also have the Advise cookie
as a
> parameter.  I could do this if both client and server were written in
C++/ATL.
> But (as far as I know) there is no way to obtain the Advise cookie in VB.

> I also thought about using the security information (obtaining the
security info
> during Advise and when the parameters are set and check for matches
between
> them), but I think the information you get from COM security is on a
per-user
> basis, and this won't work if there are two clients running on the same
machine
> (Not a likely case for me however -- so I might still be able to use this
> method.).

> Here's what I'm trying to do:

> The server has a large image buffer.  Clients will receive (through
events)
> smaller regions of interest (ROIs) of this buffer.  The client ROIs are
> independent, and would get set through some function like:

> SetImageROI(xOffset,yOffset,width,height,AdviseCookie).

> I could do this with straight function calls (client calls GetImageROI
which
> returns an image buffer), but this adds complications elsewhere in the
design.

> Has anyone found a clever away to do this without requiring the
AdviseCookie?

> Thanks,
> Pat



Sat, 11 Oct 2003 05:29:34 GMT  
 Customizing events on per-client basis (using connection points)
Thanks,  I'll try that.

Pat


Quote:
> Ah, very simple - don't use connection points - they are specifically
> designed not to support distiction between clients. Define your own
> callback mechanism, for example pass the callback interface pointer
> when specifying the ROI as another parameter:

> SetImageROI(xOffset,yOffset,width,height,pCallback,AdviseCookie)

> Where pCallback is a pointer to the client's sink implementing the
> callback interface.

> --
> =====================================
> Alexander Nickolov
> Microsoft MVP [VC], MCSD

> MVP VC FAQ: http://www.mvps.org/vcfaq
> =====================================



> > Has anyone found a way, using connection points, to customize what an
> event's
> > data will be depending on who the client is?  I thought about using the
> Advise
> > cookie, and then the parameters that determine the event's data (set by
> the
> > client(s)) will get set through functions that also have the Advise cookie
> as a
> > parameter.  I could do this if both client and server were written in
> C++/ATL.
> > But (as far as I know) there is no way to obtain the Advise cookie in VB.

> > I also thought about using the security information (obtaining the
> security info
> > during Advise and when the parameters are set and check for matches
> between
> > them), but I think the information you get from COM security is on a
> per-user
> > basis, and this won't work if there are two clients running on the same
> machine
> > (Not a likely case for me however -- so I might still be able to use this
> > method.).

> > Here's what I'm trying to do:

> > The server has a large image buffer.  Clients will receive (through
> events)
> > smaller regions of interest (ROIs) of this buffer.  The client ROIs are
> > independent, and would get set through some function like:

> > SetImageROI(xOffset,yOffset,width,height,AdviseCookie).

> > I could do this with straight function calls (client calls GetImageROI
> which
> > returns an image buffer), but this adds complications elsewhere in the
> design.

> > Has anyone found a clever away to do this without requiring the
> AdviseCookie?

> > Thanks,
> > Pat



Sat, 11 Oct 2003 20:57:14 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Looking for a sample C# client which sinks to COM event connection point

2. simple client side for a connection point

3. Neutral Apartment, Connection Point, VB Client

4. MFC Connection Point client app compilation errors...

5. Connection Point Sending Structure back to the Client

6. server/client and connection points

7. How we access cookiee return by Advise method of connection point on client side

8. How we access cookiee return by Advise method of connection point on client side

9. MFC Connection Point client app compilation errors...

10. Problem in firing Events/Connection Points

11. problem receiving events via connection points in atl

12. Connection Points - firing an event to a sink in another process

 

 
Powered by phpBB® Forum Software