🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Lionker error when using _Collection.Count property

#2612
From: Edward Diener
Date: Wed, 23 Apr 2003 22:29
68 lines
3233 bytes
Mike Ruskai wrote:
> On Tue, 22 Apr 2003 14:18:46 -0400, Edward Diener wrote:
>
>> After picking up the Adoint::_di_Properties for a TADOConnection, I
>> try to get the count of the properties using the Count VCL property
>> of the collection. Compiles fine but when I link I get:
>>
>> "[Linker Error] Unresolved external 'System::__linkproc__ __fastcall
>> CheckAutoResult()' referenced from C:\PROGRAM
>> FILES\BORLAND\CBUILDER6\LIB\DEBUG\VCLE.LIB|syssupp"
>>
>> What import library do I have to add in order to resolve this linking
>> problem ?
>
> There is none.  That function was erroneously linked into a library by
> Borland, and is not included in the compiler.
>
> The workaround is to create it yourself, most usefully in a separate
> unit file that you can include in a project whenever the need arises:
>
> [file SysFix.h - name it anything you want]
> #ifndef SysFixH
> #define SysFixH
>
//--------------------------------------------------------------------------
-
>
> #include <windows.hpp>

Any reason why I can not just pick up the "extern void __fastcall
CheckSafecallResult(HRESULT hr);" from sysclass.hpp here via system.hpp
instead of including my own extern "C" declaration in a separate header file
?

>
> extern "C"
> {
> void __fastcall CheckSafecallResult(HRESULT hr);
> }
>
> #endif
>
> [file SysFix.cpp]
> #pragma hdrstop
> #include <ComObj.hpp>
>
> #include "SysFix.h"
>
> #pragma package(smart_init)
>
> namespace System
> {
>     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.

>     }
> }
Technical Details
Message-ID: <3ea71325$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!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>

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-23 15:32:13 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>
Subject: Re: Lionker error when using _Collection.Count property
Date: Wed, 23 Apr 2003 18:29:41 -0400
Lines: 70
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.245.11.162
Message-ID: <3ea71325$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1051136805 66.245.11.162 (23 Apr 2003 15:26:45 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail