Article View: borland.public.cppbuilder.database.ado
Article #2608Re: Lionker error when using _Collection.Count property
From: Edward Diener
Date: Wed, 23 Apr 2003 02:13
Date: Wed, 23 Apr 2003 02:13
72 lines
3345 bytes
3345 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>
>
> 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);
> }
> }
That's fine but is not the same as the CheckSafecallResult() in syssupp.cpp.
I guess it will have to be good enough. I wonder, however, if it is not
possible to duplicate the CheckSafecallResult() in syssupp.cpp in another
file and call CheckAutoResult() using the correct name which the linker
accepts. Currently CheckSafecallResult() in syssupp.cpp looks like:
#pragma argsused
void __fastcall CheckSafecallResult(HRESULT hr)
{
asm
{
extrn @System@@CheckAutoResult$qqrv:near
call @System@@CheckAutoResult$qqrv
}
}
Perhaps changing the extrn identifier and call identifier in some way will
generate the correct linkage. I may play around with it in my own file, as
above, to find out rather than just calling OleCheck(hr) as above. At the
very worst I can always go back to just calling OleCheck(hr).
Technical Details
Message-ID:
<3ea5f62b@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!diablo.theplanet.net!newsfeed00.sul.t-online.de!t-online.de!newsfeed.icl.net!newsfeed.fjserv.net!out.nntp.be!propagator2-sterling!news-in.nuthinbutnews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<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-22 19:20:15 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: Tue, 22 Apr 2003 22:13:51 -0400 Lines: 75 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.13.153 Message-ID: <3ea5f62b@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1051063851 66.245.13.153 (22 Apr 2003 19:10:51 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!diablo.theplanet.net!newsfeed00.sul.t-online.de!t-online.de!newsfeed.icl.net!newsfeed.fjserv.net!out.nntp.be!propagator2-sterling!news-in.nuthinbutnews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail