Open database asynchronously in C++
I am struggling with this for several days now, so I hope someone can help
I want to open a database in asynchronous mode, so my (C++) code looks like
HRESULT hr = MyDataSource.Open("SQLNCLI10", &dbinit);
. . .
The 'Open' function returns 'DB_S_ASYNCHRONOUS' which is ok. But now my
problem arises: how do I implement the callback so I know when opening the
database has finished.
I know I have to implement the 'IDBAsynchNotify' interface
(http://msdn.microsoft.com/en-us/library/ms718270(VS.85).aspx), but it does
not work for me; most probably because I am not doing it the right way. I
hope someone can provide me some C++ code how to do this, as I have been
searching the internet for hours now, without any success.