Article View: borland.public.cppbuilder.internet.socket
Article #3226Re: sockets????
From: Gary D
Date: Sat, 29 Oct 2005 22:01
Date: Sat, 29 Oct 2005 22:01
104 lines
4473 bytes
4473 bytes
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message
news:4363bf65$1@newsgroups.borland.com...
>
>> Fire_Event1(&strName);
>
> You should not be using the & operator there:
>
> Fire_Event1(strName);
OK, its not important as it isn't part of my project anyway, only part of
Borland's Demo.
>
>> So here is the thing I am stuck on. How do I replace a local bool
>> with an external one which will use the client's existing connection?
>
> You don't.
>
OK... I think I see where your going with this but...
>> ( and accept new connections )
>
> That is handled automatically by COM for you. Every time
> TTestEventsImplImpl is instantiated, that instance represents a new client
> connection.
>
>> I can't figure out how to access Trigger() inside the Server Code at all
>
> Trigger() should be a public method of the TTestEventsImplImpl class.
> Given
> a pointer to a TTestEventsImplImpl instance, you can call Trigger() on it.
>
Yup I'll just bet I could too if ONLY:
>> let alone get an instance of it that has active connection(s) to the
> client(s).
>
> Simply keep a list of instantiated TTestEventsImplImpl instances. In
> TTestEventsImplImpl's constructor, add the 'this' pointer to the list. In
> the destructor, remove the 'this' pointer from the list. Then the server
> can loop through the list when needed.
>
I can get get tech support to explain how to get a list of instances if I
can get the rest figured out.
> TTestEventsImplImpl's constructor, add the 'this' pointer to the list
The help files say "this" is implied. What "type" is "this" I don't know.
I had less trouble learning to TALK than I'm having learning this.
Is this the list your talking about?? What should it look like when added?
Also there is no destructor. If I add one and ever refresh the type library
for some reason like adding new functions won't it vanish?
I'm not stupid but I feel that way right now.
class ATL_NO_VTABLE TTestEventsImplImpl :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<TTestEventsImplImpl, &CLSID_TestEventsImpl>,
public IConnectionPointContainerImpl<TTestEventsImplImpl>,
public TEvents_TestEventsImpl<TTestEventsImplImpl>,
public IDispatchImpl<ITestEventsImpl, &IID_ITestEventsImpl,
&LIBID_TestEventsTypeLib>
{
public:
TTestEventsImplImpl()
{
}
// Data used when registering Object
//
DECLARE_THREADING_MODEL(otApartment);
DECLARE_PROGID("TestEventsTypeLib.TestEventsImpl");
DECLARE_DESCRIPTION("");
// Function invoked to (un)register object
//
static HRESULT WINAPI UpdateRegistry(BOOL bRegister)
{
TTypedComServerRegistrarT<TTestEventsImplImpl>
regObj(GetObjectCLSID(), GetProgID(), GetDescription());
return regObj.UpdateRegistry(bRegister);
}
BEGIN_COM_MAP(TTestEventsImplImpl)
COM_INTERFACE_ENTRY(ITestEventsImpl)
COM_INTERFACE_ENTRY2(IDispatch, ITestEventsImpl)
COM_INTERFACE_ENTRY_IMPL(IConnectionPointContainer)
END_COM_MAP()
BEGIN_CONNECTION_POINT_MAP(TTestEventsImplImpl)
CONNECTION_POINT_ENTRY(DIID_ITestEventsImplEvents)
END_CONNECTION_POINT_MAP()
// ITestEventsImpl
public:
STDMETHOD(Trigger());
};
#endif //TestEventsImplImplH
Technical Details
Message-ID:
<4363f179$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<43599303@newsgroups.borland.com> <43599f5f$1@newsgroups.borland.com> <435bbbf2$1@newsgroups.borland.com> <435bc353$1@newsgroups.borland.com> <435ea916$1@newsgroups.borland.com> <435eb30b@newsgroups.borland.com> <43636b7d@newsgroups.borland.com> <4363bf65$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> <435ea916$1@newsgroups.borland.com> <435eb30b@newsgroups.borland.com> <43636b7d@newsgroups.borland.com> <4363bf65$1@newsgroups.borland.com> Subject: Re: sockets???? Date: Sat, 29 Oct 2005 17:01:53 -0500 Lines: 106 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; Original NNTP-Posting-Host: 66.38.101.139 Message-ID: <4363f179$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1130623353 66.38.101.139 (29 Oct 2005 15:02:33 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail