 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Maurice Anderson Guest
|
Posted: Fri Apr 13, 2007 8:34 pm Post subject: API Ado Events (not AdoExpress) |
|
|
I am not usung AdoExpress.
I have some Ado code using the API which works good.
hr = CoCreateInstance(
CLSID_CADOConnection,
NULL,
CLSCTX_INPROC_SERVER,
IID_IADOConnection,
(LPVOID *)&piTmpConnection
);
hr = piTmpConnection->put_Provider(L"Microsoft.Jet.OLEDB.4.0");
piTmpConnection->put_Mode(adModeReadWrite);
if(FAILED(hr))
{
return status;
}
hr = piTmpConnection->Open(
WideString(FConnectionString), WideString(FUser),
WideString(FPassword),
adConnectUnspecified);
I also have a event handler; something like:
if( FOnConnect != NULL )
{
// call the handler
FOnConnect( this, GetErrorMessage(hr), hr, IntToHex((int)hr,
10));
}
Assume all the code snippet above works fine. I now want to use Ado Events
to fire when I connect and disconnect. msdn defines the events here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdmthcnnopen.asp
My question is, how do I implement the Events? How would I integrate them
into my evens handly system?
Thanks |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|