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:
OutlookManager* poiOutMan = new OutlookManager();
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
if (!outlook.isNull()) {
Outlook::NameSpace session(outlook.Session());
folder = session.GetDefaultFolder(Outlook::olFolderContacts);
}
if (!outlook.isNull()) {
Outlook::NameSpace session(outlook.Session());
folder = session.GetDefaultFolder(Outlook::olFolderContacts);
}
To copy to clipboard, switch view to plain text mode
This is the run of the thread:
void BaseThread::run() {
//while (lock == true) {
poiOutMan -> checkApp();
//}
}
void BaseThread::run() {
//while (lock == true) {
poiOutMan -> checkApp();
//}
}
To copy to clipboard, switch view to plain text mode
And this is the method checkApp:
void OutlookManager::checkApp() {
some operations with folder
}This code crashes in the checkApp method with this error: ASSERT: "id < 0" in file qaxbase.cpp, line 3710
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...
CoCreateInstance failure (CoInitialize was not called)
QAxBase::setControl: requested control {0006f03a-0000-0000-c000-000000000046} could not be instantiated
void OutlookManager::checkApp() {
some operations with folder
}This code crashes in the checkApp method with this error: ASSERT: "id < 0" in file qaxbase.cpp, line 3710
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...
CoCreateInstance failure (CoInitialize was not called)
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 ;(
Bookmarks