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: -
-
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 3 8272
Max,
Outlook hangs around because you still have references that are attached
to it. Even if you think that you have properly freed all of the
references, objects in outlook (or any office product for that matter) have
circular references, which makes them notoriously hard to release in this
environment.
The easiest way to get rid of everything is to make sure that all
references to all outlook objects are set to null and then perform a garbage
collection. This will release all of the references that you have, and
should still keep the app running, such that when you close it (equivalent
to calling Quit on the application object) it will terminate correctly.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Max" <ma******@yahoo.com> wrote in message
news:ej**************@TK2MSFTNGP09.phx.gbl... 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:
- 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
Try this http://support.microsoft.com/default...;EN-US;Q317109
Mel
"Max" <ma******@yahoo.com> wrote in message
news:ej**************@TK2MSFTNGP09.phx.gbl... 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:
- 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
Thanks for the link. It seems to be working for Excel like the example but not for Outlook.
I wonder why Outlook has to be such a memory parasite....
"Mel Weaver" <Mel@[remove spam]insdirect.com> wrote in message news:un**************@TK2MSFTNGP15.phx.gbl... Try this http://support.microsoft.com/default...;EN-US;Q317109
Mel
"Max" <ma******@yahoo.com> wrote in message news:ej**************@TK2MSFTNGP09.phx.gbl... 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:
- 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
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Bob Swerdlow |
last post by:
My application starts up a number of processes for various purposes using:
self.popen = popen2.Popen3("/usr/local/bin/python -O "myscript.py")
and then shuts them down when appropriate with...
|
by: Fred |
last post by:
There is a setting in INIT.ORA that has the unintended side-effect of
making sure the ALTER SYSTEM KILL SESSION command has immediate affect.
Without this setting, I've seen some instances where...
|
by: Jako Menkveld |
last post by:
I'm building a relatively simple client-server app. One of the functions of
the client is to notify the server when it terminates, this all works fine.
The problem comes in when the server is...
|
by: pattanawadee |
last post by:
Deall All,
Could anybody suggestion me How to kill all inherrit processes
(sibling child,previous and parent process) in the case I know only
child process id and user id, For example I strart...
|
by: Matthew Wieder |
last post by:
What permissions must a user have to be able to succesffuly execute a
Process.Kill? I can run it with Admin privleges but not with regular
user priveleges - I get an "Access is Denied." The...
|
by: WATYF |
last post by:
This is my problem... I have some code that starts a Process and
returns it to a variable... (prcBat)
At any time while that process is running... I want to be able to Kill
it by pressing a...
|
by: Dino Buljubasic |
last post by:
My application can allow a user to open a file for viewing by fetching
file data from database, creating the file in a temp directory and
starting appropriate process (i.e. Adobe or any other...
|
by: elrondrules |
last post by:
Hi
Am new to python and need your help!!
this is my code snip.
within my python script I have the following commands..
<snip>
import os
|
by: Richard Rossel |
last post by:
Hi Fellows,
I have a problem with process termination. I have a python code that
apache runs through a django interface.
The code is very simple, first, it creates a process with the...
|
by: =?Utf-8?B?WVhR?= |
last post by:
Hello,
In the parent process(A), run update function, and start the update
process(B), in B process, kill A, then download and update files, then
restart A.
I want to know can the B process kill...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |