Article View: borland.public.cppbuilder.internet.socket
Article #3046Re: Timeout Issues [Indy 9]
From: Darlington ADIBE
Date: Mon, 28 Nov 2005 19:35
Date: Mon, 28 Nov 2005 19:35
49 lines
2855 bytes
2855 bytes
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message
news:438b485b$1@newsgroups.borland.com...
> No, it does not. That is not how you are supposed to be handling COM
errors
> in the first place. You need to check the HRESULT that the method
actually
> returns. When everything is ok, the HRESULT is set to either S_OK or some
> other positive number. A negative number indicates an error. That is how
> COM determines whether an error actually occured or not. For example:
>
This is my first COM base and Multi-thread Application please bear with me.
When I used the Type Lib Editor to add the method sendSMS to the COM
Interface, the editor added this two declearation to the file
HRESULT __fastcall sendSMS(BSTR SMSText/*[in]*/, BSTR
ToNumber/*[in]*/,
BSTR* pVal/*[out,retval]*/);
BSTR __fastcall sendSMS(BSTR SMSText/*[in]*/, BSTR
ToNumber/*[in]*/);
My assumation was that the overload functions was for convicence, since by
standard, a COM Method can only return HRESULT, the second overload method
was add to call the origainal method and handle the return of the BSTR,
thereby allowing a programmer to used code like
WideString result = COMObj->sendSMS(WideString("test"),
WideString("number"));
which is more clean and readable than
WideString result;
if( COMObj->sendSMS(WideString("some text here"), WideString("some number
here"), &result) >= 0 )
Also in VB the Method
HRESULT __fastcall sendSMS(BSTR SMSText/*[in]*/, BSTR
ToNumber/*[in]*/,
BSTR* pVal/*[out,retval]*/);
was not expose rather
BSTR __fastcall sendSMS(BSTR SMSText/*[in]*/, BSTR
ToNumber/*[in]*/);
was expose using the same COM dll and on the same machine
Technical Details
Message-ID:
<438b5b9d@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!news-peer0-test!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<43864c38@newsgroups.borland.com> <4386ba83$1@newsgroups.borland.com> <43878392@newsgroups.borland.com> <438b485b$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,83a059fbd8c24375 X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Darlington ADIBE" <bcb@triative.com> Newsgroups: borland.public.cppbuilder.internet.socket References: <43864c38@newsgroups.borland.com> <4386ba83$1@newsgroups.borland.com> <43878392@newsgroups.borland.com> <438b485b$1@newsgroups.borland.com> Subject: Re: Timeout Issues [Indy 9] Date: Mon, 28 Nov 2005 20:35:00 +0100 Lines: 51 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1506 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 NNTP-Posting-Host: 83.229.68.10 Message-ID: <438b5b9d@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1133206429 83.229.68.10 (28 Nov 2005 11:33:49 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!news-peer0-test!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail