Why is this a problem? A static member function does not imply that it isQuote:> hello,
> I am trying to use ct-lib in a muti-threaded application.
> All database access is done via a c++ class
> Currently, the two error handling callbacks (one for open client, one for
> the sql server) are defined as static member functions of the class.
> This is a problem in a multi-threaded application.
not thread safe. Just make sure that any calls you make within the error
handler are thread safe, and don't use globals/static variables in the
Or is it that you want access back to the C++ object instance which
"caused" the error? If so, I would recommend using the CS_USERDATA
property to store the "this" pointer into the command and/or connection
structure. The error handler can then get the pointer and invoke class
methods (or whatever) with it. Make sure to pay attention to the object
lifecycle so that stale pointers are never stored via CS_USERDATA.
Otto Lind Softwire Corporation (North office)