See Also
You are here: Interfacing > C++ Client Interface > scdriver Namespace > Classes > CConnection Class > CConnection Methods > SetConnectionStateCallback Method
ContentsIndexHome
PreviousUpNext
CConnection::SetConnectionStateCallback Method

Set callback function to be fired for the specified connection state. The callback routine must not use any DB functions, e.g. execute, read rows, etc.., it should do a quick operation like SetEvent()...

C++
public: void SetConnectionStateCallback(
    const CONNECTION_EVENT etype, 
    CONNECTION_STATE_CALLBACK * pcallback, 
    void * usercontext = 0
);
C#
public void SetConnectionStateCallback(
    const CONNECTION_EVENT etype, 
    CONNECTION_STATE_CALLBACK * pcallback, 
    void * usercontext
);
Visual Basic
Public Function SetConnectionStateCallback(
    etype As const CONNECTION_EVENT, 
    pcallback As CONNECTION_STATE_CALLBACK *, 
    usercontext As void * = 0
) As void
Parameters
Parameters 
Description 
etype 
Set QUERY_DONE event, which will be fired, when asynchronuos query completed 
pcallback 
Events callback routine address 
usercontext 
User defined key/value that will be passed to callback routine. 
Notes

do not call GetCompletionStatus() inside any callback functions.