E
eja24601
Hello,
I am writing an application to control a software package (referred to from
here on as "The Package") that was written in COM. I want to control this
application via the web, and my design approach is to offer a web service
that exposes the package's functions to an end user.
My current hurdles follow:
1. If The Package is already running in the server, the service fails with
the dreaded
"Retrieving the COM class factory for component with CLSID {xxx1} failed due
to the following error: 80070005" error.
I don't get this error running in debug mode (i.e., the service can grab
control of the The Package even if it is already up and running).
2. If The Package is not already running in the server, the service launches
it and can invoke its (The Package's) functions. Unfortunately, The Package
runs invisibly.
So my issues are: how can I detect if The Package is already running and
take control of it without running into the error message (I'm guessing the
error message is actually due to the fact that "someone else" has control of
The Package when my service tries to take it).
When my service launches The Package on its own, how can it launch The
Package in a "Visible" mode?
FWIW, my design approach to referencing the COM objects is:
1. Create a Class library project. In that class library project, add a
reference to the COM objects. This creates a .NET interop.
2. Create my web service, which references the Class library project.
I took the above approach because I discovered that ASP.NET web services
don't like direct COM object references. If I'm wrong with this, I'd like to
know that too, but my primary interest is in the behavior of The Package when
control is attempted from my service. As I've mentioned, I believe I've
already addressed the "80070005" error, which might be more of an
"application is already running and controlled by someone else" error.
Thanks,
Eric
I am writing an application to control a software package (referred to from
here on as "The Package") that was written in COM. I want to control this
application via the web, and my design approach is to offer a web service
that exposes the package's functions to an end user.
My current hurdles follow:
1. If The Package is already running in the server, the service fails with
the dreaded
"Retrieving the COM class factory for component with CLSID {xxx1} failed due
to the following error: 80070005" error.
I don't get this error running in debug mode (i.e., the service can grab
control of the The Package even if it is already up and running).
2. If The Package is not already running in the server, the service launches
it and can invoke its (The Package's) functions. Unfortunately, The Package
runs invisibly.
So my issues are: how can I detect if The Package is already running and
take control of it without running into the error message (I'm guessing the
error message is actually due to the fact that "someone else" has control of
The Package when my service tries to take it).
When my service launches The Package on its own, how can it launch The
Package in a "Visible" mode?
FWIW, my design approach to referencing the COM objects is:
1. Create a Class library project. In that class library project, add a
reference to the COM objects. This creates a .NET interop.
2. Create my web service, which references the Class library project.
I took the above approach because I discovered that ASP.NET web services
don't like direct COM object references. If I'm wrong with this, I'd like to
know that too, but my primary interest is in the behavior of The Package when
control is attempted from my service. As I've mentioned, I believe I've
already addressed the "80070005" error, which might be more of an
"application is already running and controlled by someone else" error.
Thanks,
Eric