suppress CoInitialize call within CSession::Open()
- From: "vijay singh" <vijaysingh@xxxxxxxxxxxxxxx>
- Date: Thu, 29 May 2008 16:01:36 +0530
Platform - Windows XP, OleDB, VC8
Database - Oracle, Microsoft Access
Hi,
I have developed multithread application. Each worker threads uses OleDB to
access data. Code is given below:
CDataSource ds;
void Run()
{
HRESULT hr = CoInitializeEx(NULL,COINIT_MULTITHREADED);
CSession session;
// start the session
hr = session.Open(ds); // suppose data source is already open
if(FAILED(hr))
{
cout << "Can't open SESSION" << endl;
return -1;
}
....
....
....
CoUninitialize();
}
When I profile this application using AQTime I found error that is
'Cannot
change thread mode after it is set'. When I check stack for this error I
found that there is CoInitialize() call within CSession::Open(). Is
there
any way to supperess CoInitialize() call within CSession::Open() because
my
program is already calling CoInitializeEx(NULL,COINIT_MULTITHREADED).
Thanks in advance,
Vijay Singh
EDISPHERE Software
.
- Prev by Date: CoInitialize call within CSession::Open()
- Previous by thread: CoInitialize call within CSession::Open()
- Index(es):
Relevant Pages
|
|