• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 484
  • Last Modified:

Controlling MS Word via COleDispatchDriver

I have an app which controls MS Word 97 via COleDispatchDriver. The problem is that "winword.exe" stays in memory (abnormally long, I checked it with Task Manager) although I use COleDispatchDriver::ReleaseDispatch().
I've also tried the following simple code snippet which leads to the same problem.

void CMyView::OnTest()
    COleDispatchDriver disp;
    // do something useful

What am I doing wrong??
  • 2
1 Solution
searchingAuthor Commented:
Edited text of question.
searchingAuthor Commented:
Edited text of question.
Tommy HuiEngineerCommented:
Word conforms to the Automation specifications for servers that implement a user interface. There are various problems of having a UI in an automation server due to reference counting and such. So in order to get around these problems, Word still stays in memory even when you release its IDispatch interface. The correct way of closing down Word is to call the Application's Quit method and then releasing the interface.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now