ashishagnihotri
asked on
How to close one instance of an OLE application without closing its RPC server along with it
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Force Accepted
SpideyMod
Community Support Moderator @Experts Exchange
SpideyMod
Community Support Moderator @Experts Exchange
try
Excel:=GetActiveOLEObject(
except
try
Excel:=CreateOLEObject('Ex
except
MessageDlg('Cannot create Ole object'#39
+'Excel.Application!',mtEr
exit;
end;
end;