Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7835469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:38:55+00:00 2026-06-02T13:38:55+00:00

When i started my app and opened word file i see 3 process winword.exe

  • 0
  1. When i started my app and opened word file i see 3 process winword.exe in taskmanager.
    After i called ‘close’ function 1 process winword.exe closed.

  2. When i called worddoc.close() or wordapp.quit() in destructor, i got exception “COM object that has been separated from its underlying RCW cannot be used.”

public class WordHelper
{
    private object nullobj = System.Reflection.Missing.Value;

    public string context = "";

    Microsoft.Office.Interop.Word.Document doc = new Document();
    Microsoft.Office.Interop.Word.Application wordApp = new Application();

    public WordHelper(string FileName)
    {
           //Open word file
    }

    //somefunction fo work with file

    public void CloseWord()
    {
        doc.Close();
        wordApp.Quit();
        System.Runtime.InteropServices.Marshal.FinalReleaseComObject(wordApp);
    }

    ~WordHelper()
    {
        //i got exception
        doc.Close();
        wordApp.Quit();
        System.Runtime.InteropServices.Marshal.FinalReleaseComObject(wordApp);
    }
}

How i call my class

        WordHelper wddoc = new WordHelper("C:\\Test Word\\Test.docx");
        wddoc.CloseWord(); //this line i use and can close 1 process not 3
        //One process close after i close application

At the end i want close all winword.exe which was opened by my application, and i want to close them in destructor. At the end, i need to close all ‘winword.exe’ which was opened by my application, and i need to close them in destructor.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T13:39:02+00:00Added an answer on June 2, 2026 at 1:39 pm

    You are doing this in a finalizer (different than a destructor). Finalizers are non-deterministic, meaning by the time they run class members may have already been finalized and thus would no longer be valid.

    I would implement the Dispose pattern and explicitly control the lifetime of your word COM objects. This answer has a lot of good links that may help you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My iPad app was working fine until I opened up IB and started editing
My iPhone app started logging this error: lo->hi recycling invariant violated! followed by: Program
Just getting started building an app using the v6 of the facebook c# sdk
I am working on an existing ASP.NET MVC app that started small and has
I started developing an android app that have to interact with MMS attachements, in
I started writing functional tests for my rails app today. I use the RESTful
A desktop app (made in Delphi) is started by User A. Let's call it
I started a grails application by grails create-app. For modularity, I feel like it
I started deploying my latest RoR app on Heroku , which required me to
From the GAE getting started guide Because the App Engine datastore is not a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.