473,569 Members | 2,557 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

guaranteee automation kills_handle events

1) want to kill my automation server processes when i'm done with them.
i.e., want to make sure that my word and outlook processes that are
displayed in task manager are disposed of when i'm done. i set to null in
code but that doesn't kill process.

2) how do handle events in outlook and potentially word. need to create a
custom event for when the outlook email message closes either by send email
or user closing form.

thanks.
Nov 16 '05 #1
1 1215
Devhead,

For #1, you will have to make sure that you call the static
ReleaseComObjec t method on the Marshal class, passing every reference that
you get from COM. The reason for this is that every object in word and
outlook usually has a reference to the parent, so you have to be diligent in
releasing them. Unfortunately, those object models have huge hierarchies,
which means that every time you access a property, it is returning a new COM
object that you have to call ReleaseComObjec t on.

Needless to say, you can not just set to null. You need to explicitly
dispose of the object.

As for handling events, there should be events exposed through the
objects in the Primary Interop Assemblies which you are interacting with
Word and Outlook. Either that, or events should be exposed through the
results of running TLBIMP on those dlls.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Devhead" <de******@bells outh.net> wrote in message
news:ub******** ******@TK2MSFTN GP11.phx.gbl...
1) want to kill my automation server processes when i'm done with them.
i.e., want to make sure that my word and outlook processes that are
displayed in task manager are disposed of when i'm done. i set to null in
code but that doesn't kill process.

2) how do handle events in outlook and potentially word. need to create a
custom event for when the outlook email message closes either by send
email or user closing form.

thanks.

Nov 16 '05 #2

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

Similar topics

17
6320
by: Mansi | last post by:
I need to do some research on how to use excel automation from c#. Does anyone know of any good books related to this subject? Thanks. Mansi
7
2051
by: lkr | last post by:
hi is there is anyway to capture the document events of a MSWord?eg:I have to handle the event awhen WM_KEYUP or anyother events will occur. give me a solution............ thanks in advance lkr
0
7700
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7614
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8125
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
5513
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3642
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1221
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.