473,399 Members | 2,159 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Kill Process

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:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Type objClassType = Type.GetTypeFromProgID("Outlook.Application", true);
  3. object objApp_Late = Activator.CreateInstance(objClassType);
  4.  
  5. // .... code here that does something .... //
  6.  
  7. object[] parameters = new object[1];
  8. parameters[0] = objApp_Late;
  9. objMailItem_Late.GetType().InvokeMember("Display", BindingFlags.InvokeMethod, null, objMailItem_Late, parameters);
  10.  
  11.  
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
Nov 17 '05 #1
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:

Expand|Select|Wrap|Line Numbers
  1.  Type objClassType = Type.GetTypeFromProgID("Outlook.Application", true);
  2.  object objApp_Late = Activator.CreateInstance(objClassType);
  3.  // .... code here that does something .... //
  4.  object[] parameters = new object[1];
  5.  parameters[0] = objApp_Late;
  6.  objMailItem_Late.GetType().InvokeMember("Display",
  7.  BindingFlags.InvokeMethod, null, objMailItem_Late, parameters);
  8.  

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

Nov 17 '05 #2
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:

Expand|Select|Wrap|Line Numbers
  1.  Type objClassType = Type.GetTypeFromProgID("Outlook.Application", true);
  2.  object objApp_Late = Activator.CreateInstance(objClassType);
  3.  // .... code here that does something .... //
  4.  object[] parameters = new object[1];
  5.  parameters[0] = objApp_Late;
  6.  objMailItem_Late.GetType().InvokeMember("Display",
  7.  BindingFlags.InvokeMethod, null, objMailItem_Late, parameters);
  8.  

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

Nov 17 '05 #3
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:

Expand|Select|Wrap|Line Numbers
  1.  Type objClassType = Type.GetTypeFromProgID("Outlook.Application", true);
  2.  object objApp_Late = Activator.CreateInstance(objClassType);
  3.  // .... code here that does something .... //
  4.  object[] parameters = new object[1];
  5.  parameters[0] = objApp_Late;
  6.  objMailItem_Late.GetType().InvokeMember("Display",
  7.  BindingFlags.InvokeMethod, null, objMailItem_Late, parameters);
  8.  

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


Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
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...
10
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...
10
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...
3
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...
6
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...
0
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...
5
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...
3
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
4
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...
2
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...
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
marktang
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,...
0
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...
0
jinu1996
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...
0
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...
0
agi2029
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,...
0
isladogs
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.