🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Timeout Issues [Indy 9]

#3052
From: Remy Lebeau (TeamB)
Date: Tue, 29 Nov 2005 09:56
66 lines
3577 bytes
"Darlington ADIBE" <bcb@triative.com> wrote in message
news:438c1166@newsgroups.borland.com...

> Then it will been more correct to alway call the second method
> and allow the wrapper to do it basic function rather than bypass
> it by calling the first (actual) declaration

There are times when the wrapper is not efficient or desired.  Having both
options available allows you to choose the best one for your actual code.

> What you are saying is that there is a difference between this
>
>  WideString result;
>  result = COMObj->sendSMS(WideString("test"), WideString("number"));
>
> and this
>
>  WideString result  = COMObj->sendSMS(WideString("test"),
> WideString("number"));

There can be, yes.  In the second one, there are two possibilities that can
occur due to , or lack of, optimizations during compiling:

1) a default-constructed WideString is created and then the '=' operator is
invoked.  This is the same as the first one further above.  No memory leak
occurs in this situation.

2) the call to the '=' operator is omitted and the BSTR from the COM object
is passed to WideString's BSTR constructor instead, ie:

    WideString result(COMObj->sendSMS(WideString("test"),
WideString("number")));

A memory leak occurs in this situation since the constructor does not take
ownership of the BSTR.

> it more easier if am developing the COM to be used just within
> my own App.  but in this case my COM is targetted to third
> party developers.

That is exactly what COM is good for.  BCB-created COM objects can work just
fine in other environments.  You just have to learn about the quirks in the
VCL and wrapper codes to make sure you do things properly.

> is including the
> public ISupportErrorInfoImpl<&IID_IesemesAPI>
>
> and using
> return Error(e.Message.c_str(), IID_IesemesAPI, E_UNEXPECTED);
>
> to return Error good enough for my COM such that the third
> party developer can use all the standard error handling routin
> you have mentioned so far (for VB & C++).

Non-Borland environments expect IErrorInfo to be used.  That is part of the
standard COM error handling architecture.

> Which of this method do i document for the COM user

The first one.  As I told you before, the second one is only Borland wrapper
code, and is not accessible to non-Borland environments at all.  They can
only use what is actually in the Type Library.


Gambit
Technical Details
Message-ID: <438c25f8$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!meganewsservers.com!feeder2.on.meganewsservers.com!news-out.superfeed.net!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <43864c38@newsgroups.borland.com> <4386ba83$1@newsgroups.borland.com> <43878392@newsgroups.borland.com> <438b485b$1@newsgroups.borland.com> <438b5b9d@newsgroups.borland.com> <438b859f$1@newsgroups.borland.com> <438c1166@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: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.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> <438b5b9d@newsgroups.borland.com> <438b859f$1@newsgroups.borland.com> <438c1166@newsgroups.borland.com>
Subject: Re: Timeout Issues [Indy 9]
Date: Tue, 29 Nov 2005 01:56:12 -0800
Lines: 68
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <438c25f8$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1133258232 68.69.17.41 (29 Nov 2005 01:57:12 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!meganewsservers.com!feeder2.on.meganewsservers.com!news-out.superfeed.net!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail