🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #3352

Re: sockets????

#3352
From: Gary D
Date: Mon, 24 Oct 2005 10:38
60 lines
3616 bytes
Thank you for the help, I am totally new at COM so I have had a rough ride 
even getting this far.
I at least understand what I'm reading here now. I will try to work through 
your explanation
and see if I can get it to work.

Gary D

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:435bc353$1@newsgroups.borland.com...
>
> "Gary D" <gcdesroches@nctc.com> wrote in message 
> news:435bbbf2$1@newsgroups.borland.com...
>
>> If you can make a COM server broadcast without needing a request
>> from a client can you tell me how you did it?
>
> Event sinks.  A client registers a sink with the server, and then the 
> server can trigger events to that sink whenever it wants.  A common way to 
> do that is via Connection Points.  When you create a new COM object in the 
> IDE's ActiveX wizards, you have an option to "Generate Event Support". 
> This option adds an additional IDispatch-derived interface to your Type 
> Library where you can then define your event methods.  The COM object's 
> Impl class will then have a TEvent_... class added to its ancestor list 
> which implements Fire_...() methods for the events.  The server code can 
> call these methods at any time to trigger events in connected clients. 
> The client's code can then derive a class from that interface, or 
> alternatively use the VCL's TEventDispatcher class, to implement the event 
> handling as needed.  In the case of TEventDispatcher, it has a 
> ConnnectServer() method that you can use to hook up the TEventDispatcher 
> to your COM object instance.  If you don't use TEventDispatcher, then you 
> have to manually query the COM object for the IConnectionPointContainer 
> interface, call its FindConnectionPoint() method to get an 
> IConnectionPoint interface, and then finally call its Advise() method 
> passing it an instance of your sink class.
>
> Refer to the following articles for more details:
>
>    Events/Callbacks
>    http://www.techvanguards.com/com/concepts/events.asp
>
>    Implementing an Event Framework
>    http://www.techvanguards.com/com/tutorials/eventsystem.asp
>
> The code examples are in Delphi, but the concepts can be applied to C++ as 
> well.
>
>> Borland support says it can't be done.
>
> What EXACTLY was said?
>
>> ( Remember it's an UNSOLICITED broadcast I'm after, no client
>> involvment other than receiving )
>
> The client has to register its interest in receiving events.  You can do 
> that right after instantiating the COM object.
>
>
> Gambit
> 
Technical Details
Message-ID: <435cb938@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!fr.ip.ndsoftware.net!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <43599303@newsgroups.borland.com> <43599f5f$1@newsgroups.borland.com> <435bbbf2$1@newsgroups.borland.com> <435bc353$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,b9d755a2fd611a30
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "Gary D" <gcdesroches@nctc.com>
From: "Gary D" <gcdesroches@nctc.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <43599303@newsgroups.borland.com> <43599f5f$1@newsgroups.borland.com> <435bbbf2$1@newsgroups.borland.com> <435bc353$1@newsgroups.borland.com>
Subject: Re: sockets????
Date: Mon, 24 Oct 2005 05:38:38 -0500
Lines: 62
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 66.38.101.139
Message-ID: <435cb938@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1130150200 66.38.101.139 (24 Oct 2005 03:36:40 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!fr.ip.ndsoftware.net!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail