🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #2619

Re: Lionker error when using _Collection.Count property

#2619
From: Edward Diener
Date: Fri, 25 Apr 2003 22:29
54 lines
3544 bytes
Mike Ruskai wrote:
> On Wed, 23 Apr 2003 18:29:41 -0400, Edward Diener wrote:
>
> [snip]
>
>>>     void __fastcall CheckSafecallResult(HRESULT hr)
>>>     {
>>>     OleCheck(hr);
>>
>> I tried fooling around by duplicating here and changing slightly the
>> code in the VCL's CheckSafecallResult call in syssupp.cpp to see if
>> I could actually get it to link correctly with the actual
>> CheckAutoResult function, which must be specified in some BPL, but
>> to no avail. Using OleCheck(hr) works as far as linking occurs but I
>> wonder if it is actually as good as CheckAutoResult if an error
>> actually does result and hr is set to an error code. Does anybody
>> know about this ? It would really be nice if Borland could fix this
>> so that whatever wondrous thing is encoded in CheckAutoResult really
>> happens in that case.
>
> You're misunderstanding the nature of the problem.  There is no
> CheckAutoResult anywhere in Borland's libraries.  Whatever its use
> during BCB development, it was not included in the final product, but
> was erroneously referred to in that bit of code.

There is a _CheckAutoResult in system.pas. If it has not been included in
any library, even though it is in the source, that's fine and you are
correct. I thought it might have since it was in the source.

>
> The solution is to replace CheckSafecallResult, so that it calls a
> function which actually exists.

Done according to your instructions. But I included system.hpp which already
has a declaration for CheckSafecallResult rather than make my own header
file for a declaration ( why extern "C" in your original example ? ) and
that works in getting my project to compile and link.

>
> I don't know if OleCheck does everything that CheckAutoResult
> presumably would do.  I haven't dug deep enough to even find where
> this function is declared, much less defined.

See above.

>  My guess is that it
> simply throws an exception if there's an OLE error, which does in
> fact happen when such errors occur. They're remarkably useless, in
> BCB, for finding the cause of the error, but it does allow one to
> avoid shipping code that doesn't work.

Well CheckAutoResult in system.pas does a bit more but hopefully OleCheck
will be good enough as trying to duplicate the system.pas CheckAutoResult
seems difficult as it appears to rely on internal VCL functionality.
Technical Details
Message-ID: <3ea9b606$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3ea586d5$1@newsgroups.borland.com> <gunaalqrneguyvaxarg.hdru980.pminews@207.105.83.65> <3ea71325$1@newsgroups.borland.com> <gunaalqrneguyvaxarg.hdvtpe0.pminews@207.105.83.65>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,46b82a3e4cd2c8eb
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2003-04-25 15:31:45 PST
From: "Edward Diener" <eddielee@tropicsoft.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3ea586d5$1@newsgroups.borland.com> <gunaalqrneguyvaxarg.hdru980.pminews@207.105.83.65> <3ea71325$1@newsgroups.borland.com> <gunaalqrneguyvaxarg.hdvtpe0.pminews@207.105.83.65>
Subject: Re: Lionker error when using _Collection.Count property
Date: Fri, 25 Apr 2003 18:29:09 -0400
Lines: 56
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 66.32.65.71
Message-ID: <3ea9b606$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1051309574 66.32.65.71 (25 Apr 2003 15:26:14 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail