Hi
My software is a thread that every n minutes calls the method for obtaining the outlook appointments. The problem is that the method crashes down.

This is a part of code of the constructor of the thread:
Qt Code:
  1. OutlookManager* poiOutMan = new OutlookManager();
To copy to clipboard, switch view to plain text mode 
This is a part of code of the contrstuctor of class OutlookManager, which reads data from Outlook and contains a field Outlook::Application outlook
Qt Code:
  1. if (!outlook.isNull()) {
  2.  
  3. Outlook::NameSpace session(outlook.Session());
  4. folder = session.GetDefaultFolder(Outlook::olFolderContacts);
  5.  
  6. }
To copy to clipboard, switch view to plain text mode 
This is the run of the thread:
Qt Code:
  1. void BaseThread::run() {
  2.  
  3. //while (lock == true) {
  4.  
  5. poiOutMan -> checkApp();
  6.  
  7. //}
  8.  
  9. }
To copy to clipboard, switch view to plain text mode 
And this is the method checkApp:
Qt Code:
  1. void OutlookManager::checkApp() {
  2. some operations with folder
  3.  
  4.  
  5.  
  6.  
  7. }This code crashes in the checkApp method with this error: ASSERT: "id < 0" in file qaxbase.cpp, line 3710
  8. So I've tried to launch the construction of OutlookManager directly in the run of the thread and to import the checkApp code in the constructor of OutlookManager but it returns a compile error: Starting C:\Documents and Settings\STAGE04\Desktop\Stage Gian\VisionSync\debug\VisionSync.exe...
  9. CoCreateInstance failure (CoInitialize was not called)
  10.  
  11. QAxBase::setControl: requested control {0006f03a-0000-0000-c000-000000000046} could not be instantiated
To copy to clipboard, switch view to plain text mode 
Could you please help me? I've tried to find a solution since two days ago but no luck ;(