M
Max
I use late binding to have my program compatible with multiple versions of Microsoft Outlook.
Here is a snipped of my code that launches Microsoft Outlook and displays it to the user:
At the very end I display the instance to the user so s/he can interact with Outlook, while my program continues on. I noticed that
when the user closes Outlook and continues using my program, OUTLOOK.EXE still lives on when you look in the task manager list,
wasting memory space. When my app opens up Outlook again and the user closes it another OUTLOOK.EXE instance remains in memory and
so on.
How can I stop this from happening? Is it possible to wait for user to quit Outlook and return to my program and clean up, or is
there a way to just kill OUTLOOK.EXE once it's closed by the user. Any idea why OUTLOOK.EXE hangs on even after it is closed by the
user?
Cheers,
Max
Here is a snipped of my code that launches Microsoft Outlook and displays it to the user:
Code:
Type objClassType = Type.GetTypeFromProgID("Outlook.Application", true);
object objApp_Late = Activator.CreateInstance(objClassType);
// .... code here that does something .... //
object[] parameters = new object[1];
parameters[0] = objApp_Late;
objMailItem_Late.GetType().InvokeMember("Display", BindingFlags.InvokeMethod, null, objMailItem_Late, parameters);
At the very end I display the instance to the user so s/he can interact with Outlook, while my program continues on. I noticed that
when the user closes Outlook and continues using my program, OUTLOOK.EXE still lives on when you look in the task manager list,
wasting memory space. When my app opens up Outlook again and the user closes it another OUTLOOK.EXE instance remains in memory and
so on.
How can I stop this from happening? Is it possible to wait for user to quit Outlook and return to my program and clean up, or is
there a way to just kill OUTLOOK.EXE once it's closed by the user. Any idea why OUTLOOK.EXE hangs on even after it is closed by the
user?
Cheers,
Max