Evgeny Tatarincev
Posts: 1
Joined: 2009-04-09
|
public class AddinModule : AddinExpress.MSO.ADXAddinModule
{
private static Outlook.MAPIFolder _oFolder;
...
private void AddinModule_AddinInitialize(object sender, EventArgs e)
{
Outlook._NameSpace ns = OutlookApp.GetNamespace("MAPI");
_oFolder =
ns.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderCalendar);
//acess to _oFolder in module thread
bool bTest = _oFolder.Items.Count > 1;
Thread myThread = new Thread(new ThreadStart(ThreadProc));
myThread.Start();
}
private void ThreadProc()
{
//acess to _oFolder in other thread
bool bTest = _oFolder.Items.Count > 1 //Function evaluation disabled
//because a previous function
//evaluation timed out.
//You must continue execution
//to reenable function valuation.
}
...
}
I'm see all post in this forums. And do not find resolution this problem.
All threading examples in forum posts using static outlook variables correctly. Sorry for my english. |
|
Andrei Smolin
Add-in Express team
Posts: 19138
Joined: 2006-05-11
|
Hello Evgeny,
The Excel Object Model isn't thread safe. You need to use it in the main thread only.
Andrei Smolin
Add-in Express Team Leader |
|
Andrei Smolin
Add-in Express team
Posts: 19138
Joined: 2006-05-11
|
Sorry for the misprint. I mean the Outlook object model, of course.
Andrei Smolin
Add-in Express Team Leader |
|