🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
1 messages
1 total messages Started by Maurice Anderson Fri, 13 Apr 2007 15:34
API Ado Events (not AdoExpress)
#2151
Author: Maurice Anderson
Date: Fri, 13 Apr 2007 15:34
44 lines
2161 bytes
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 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads