Article View: borland.public.cppbuilder.internet.socket
Article #3126Re: sockets????
From: Gary D
Date: Tue, 01 Nov 2005 23:08
Date: Tue, 01 Nov 2005 23:08
86 lines
4140 bytes
4140 bytes
Here is the TestEventsImplImpl.cpp File as modified to add your code:
I will Follow this with another message or 2 showing the rest of the files
you need to see.
// TESTEVENTSIMPLIMPL : Implementation of TTestEventsImplImpl (CoClass:
TestEventsImpl, Interface: ITestEventsImpl)
#include <vcl.h>
#pragma hdrstop
#include "TESTEVENTSIMPLIMPL.H"
#include "frmServer.h"
/////////////////////////////////////////////////////////////////////////////
//---------------------------------------------------------------------------
TThreadList* TTestEventsImplImpl::InterfaceList = NULL; // Code added from
newsgroup info
//---------------------------------------------------------------------------
TTestEventsImplImpl::TTestEventsImplImpl() // Function Def added from
newsgroup info
{
if(!InterfaceList)
InterfaceList = new TThreadList;
if(InterfaceList)
InterfaceList->Add(this);
}
//---------------------------------------------------------------------------
TTestEventsImplImpl::~TTestEventsImplImpl() // Function Def added from
newsgroup info
{
if(InterfaceList)
{
TList *list = InterfaceList->LockList();
int index = list->IndexOf(this);
if(index > -1)
list->Delete(index);
int count = list->Count;
InterfaceList->UnlockList();
if(count < 1)
{
delete InterfaceList;
InterfaceList = NULL;
}
}
}
//---------------------------------------------------------------------------
// TTestEventsImplImpl
STDMETHODIMP TTestEventsImplImpl::Trigger() // Existing
Function
{
WideString strName; // Existing Code
TTestEventsImplImpl *pIntf = NULL; // Code added
from newsgroup info
TList *list = InterfaceList->LockList(); // Code added
from newsgroup info
for(int x = 0; x < list->Count; x++) // Code added
from newsgroup info
{
try // Code added
from newsgroup info
{
pIntf = (TTestEventsImplImpl *)list->Items[x]; // Code added
from newsgroup info
if(pIntf) // Code added
from newsgroup info
pIntf->Fire_Event1(&strName); // Code Modified
from newsgroup info
}
catch(...) { } // Code added
from newsgroup info
}
InterfaceList->UnlockList(); // Code added
from newsgroup info
// Fire_Event1(strName); // Existing
Code
return S_OK; // Existing Code
}
//---------------------------------------------------------------------------
Technical Details
Message-ID:
<4367f582@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!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> <436367ef$1@newsgroups.borland.com> <4363be5e$1@newsgroups.borland.com> <4366d403@newsgroups.borland.com> <43670f39$2@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> <436367ef$1@newsgroups.borland.com> <4363be5e$1@newsgroups.borland.com> <4366d403@newsgroups.borland.com> <43670f39$2@newsgroups.borland.com> Subject: Re: sockets???? Date: Tue, 1 Nov 2005 17:08:26 -0600 Lines: 88 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: <4367f582@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1130886530 66.38.101.139 (1 Nov 2005 15:08:50 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail