🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TADOTable and BeforeEdit Event Handler

#3210
From: Vassiliev V.V.
Date: Fri, 06 Dec 2002 19:43
51 lines
2484 bytes
Your function must be declared inside class such as

void __fastcall TForm1::MyBeforeEdit (TDataSet *DataSet){};

If you need an external function you should write something like:

class MyClass
{
 public:
  void __fastcall MyBeforeEdit(TDataSet *DataSet) {/*Your code here*/};
} MyVar;


__fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner)
{
 ADODataSet1->BeforeEdit = MyVar.MyBeforeEdit;
}

----------------------------------------------------------------
Regards,
Viatcheslav V. Vassiliev
http://www.oledbdirect.com
The fastest way to access MS SQL Server, MS Jet (MS Access)
and Interbase (LCPI provider, http://www.lcpi.lipetsk.ru) databases.

"Kim Utley" <kim@simsware.com> �������/�������� � �������� ���������:
news:3df0cd97$1@newsgroups.borland.com...
> Hi All!
>
> Have what should be a very simple question. I wish to write an event
handler
> for BeforeEdit and AfterEdit. However, I'm getting the following error on
a
> function declared as:
>
> void __fastcall MyBeforeEdit( TDataSet * dataSet ) {
>     //    some stuff...
> }
>
> Cannot convert 'void (__fastcall *)TDataSet *)' to 'void (__fastcall *
> (__closure)(TDataSet *))(TDataSet *)'
>
> Does this mean I have to derive a class from TADOTable in order for the
> class to call my functions? If so it would seem strange since I get a
> pointer to the TDataSet object as an argument.
>
> TIA,
>
> Kim
>
>
Technical Details
Message-ID: <3df10286@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newspump.sol.net!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3df0cd97$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10698b,8ef346d90d5f49bd
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2002-12-06 12:10:10 PST
From: "Vassiliev V.V." <news@vassilievvv.mtu-net.ru>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3df0cd97$1@newsgroups.borland.com>
Subject: Re: TADOTable and BeforeEdit Event Handler
Date: Fri, 6 Dec 2002 22:43:15 +0300
Lines: 53
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 212.188.99.217
Message-ID: <3df10286@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1039204998 212.188.99.217 (6 Dec 2002 12:03:18 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newspump.sol.net!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail