[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

How to close one instance of an OLE application without closing its RPC server along with it

Posted on 2002-05-01
3
Medium Priority
?
296 Views
Last Modified: 2010-04-04
Hi Community,

I have developed an application in Delphi 5, which reads information from a MS WORD document and parses it into HTML. I have used OLE technology to achieve this. The problem is that if I start another instance of MS Word form the start menu while I am running my application and close the MS Word (application that i started from the start menu) the RPC server instance also gets destroyed and everytime I want to refresh the details in my Delphi application an error message appears saying "RPC Server not found" .

How to overcome this problem ? I havetried using threads etc. Please suggest me something .

Thanks and regards

Ashish Agnihotri
0
Comment
Question by:ashishagnihotri
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 

Expert Comment

by:lottol
ID: 6985134
You can check active OLE object. Here is an example of it for Excel.

try
  Excel:=GetActiveOLEObject('Excel.Application');
except
  try
   Excel:=CreateOLEObject('Excel.Application');
  except
   MessageDlg('Cannot create Ole object'#39
               +'Excel.Application!',mtError,[mbOK],0);
   exit;
  end;
end;
0
 
LVL 2

Accepted Solution

by:
CSJ earned 300 total points
ID: 7251280
Hi,
This is a fault in some versions of word, please refer to following link:
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q188546

To get round this you have to create a temporary ole instance:

var
  Word972000Bug, WP : Variant;
begin
  Word972000Bug := CreateOleObject('Word.Basic');
  WP := CreateOleObject('Word.Basic');
  Word972000Bug.AppClose;
  Word972000Bug := Unassigned;
  WP.AppShow;
  ..
end;

Hope this helps

Craig
0
 

Expert Comment

by:SpideyMod
ID: 8280690
Force Accepted

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question