Results 1 to 2 of 2

Thread: Outlook problem

  1. #1
    Join Date
    Oct 2009
    Posts
    6
    Platforms
    MacOS X Unix/X11 Windows

    Default Outlook problem

    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 ;(

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Outlook problem

    You can't access widgets (and other operating system resources) from worker threads. You probably are trying to and thus get occasional crashes.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Problem with QAbstractListModel
    By eekhoorn12 in forum Qt Programming
    Replies: 3
    Last Post: 26th August 2009, 14:26
  2. Replies: 1
    Last Post: 23rd April 2009, 09:05
  3. Replies: 19
    Last Post: 3rd April 2009, 23:17
  4. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  5. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.