QueryInterface for interface * failed. (Using COM Interop dll in web application)



Hi everyone...
I'm faceing a problem that I want to shae with you and I'm hoping that
somebody will give write solution.

I wrote a COM dll in Visual C++ 6.0 and MFC that generates some report. I'm
using Visual Studio (ver. 2003) to create interop for COM dll cause I want
to use in a web project (asp.net 1.1, c#). I'm adding my COM dll in
References of the web project and everything is cool.
COM dll is registered to OS and I'm able to use it in web application.
Here is the simplified example of how I'm using the Interop in web project:

public class X : Base
{
// members
protected Object comObj;

// some other methods

protected ShowReport()
{
try
{
comObj = new ReportsClass();
String htmlFormatedStr = ((ReportsClass)comObj).GetReport(/*some
id*/);
}
catch(COMException comExc)
{
// log exception
}
catch(Exception exc)
{
// log general exception
}
}
}

I don't have any problem on development enviroment (Windows XP, VS2003, .NET
Framework 1.1, IIS 5.1). I'm getting results and everything is fine. Page
that is the container of the user control where my COM object is
instantiated has AspCompat = "true" in @Page directive.
The problem is when I deploy same version on test enviroment (Winwods 2003,
..NET Framework 1.1, IIS 6) and it's very strange. I start web application on
test enviroment for the first time and everything is cool I can send request
for report and I'm getting the proper results. After I quit browser (IE) and
start application again I got error (QueryInterface for interface
OssDsDCOM.IProducts failed... see details of the exception to the bottom of
the this message) and I can not see report. If I restart IIS (IISReset) then
I'm able again to use com object without any problems untill next closeing
of the browser. (This is the pattern one that is based on the following
rules. I can use com obj only first time when I make request to instantiate
and I can call it unlimited number of times and it works cool untill I close
browser, than I should restart IIS if I want to use com obj again)
I tryed also what it will be if I restart IIS start web applicaton and use
com obj to get proper results and try to open onother browser (CTRL+N) and
try to use report (com obj) from other prowser without closing the fist one
where com obj is working corectlly in that time but, ni second browser I got
the known exception which details can be found to the bottom of this
message.
I chnage test enviroment and I tried to another phisical server (Windows
2003, .NET Framework 1.1, IIS 6) and problem continue to exist.

So, would you please help me to solve this problem cause it's very importan
to me.

Thank you for your time reading this description about my problem.

Regards,
Vasil Buraliev

************************************************************************
DETAILS ABOUT EXCEPTION
************************************************************************
MESSAGE: QueryInterface for interface OssDsDCOM.IProducts failed.

SOURCE: mscorlib

STACK TRACE: at System.RuntimeType.InvokeDispMethod(String name,
BindingFlags invokeAttr, Object target, Object[] args, Boolean[]
byrefModifiers, Int32 culture, String[] namedParameters)

at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr,
Binder binder, Object target, Object[] args, ParameterModifier[] modifiers,
CultureInfo culture, String[] namedParameters)

at System.RuntimeType.ForwardCallToInvokeMember(String memberName,
BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&
msgData)

at OssDsDCOM.ProductsClass.GetCurrentView(String lpLegalActorID)

at DistrSys.WebUI.users.modules.UCConDGUIDetails.ShowProduct(String
strProductID, ArrayList prodParams)

TARGET SITE NAME: InvokeDispMethod

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.

************************************************************************


.



Relevant Pages

  • Re: QueryInterface for interface * failed. (Using COM Interop dll in web application)
    ... // log general exception ... The problem is when I deploy same version on test enviroment (Winwods ... untill next closeing of the browser. ... I can use com obj only first time when I ...
    (microsoft.public.dotnet.framework.interop)
  • Re: Cant use web links from messages
    ... What registering a DLL does is add/update some entries in the registry. ... That's necessary if some other program deleted or modified the registry entries. ... > Choose 'Extract One File From Installation Disk'. ... >> How to Make Internet Explorer the Default Web Browser ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: (Re)throwing from a catch block across dll boundaries
    ... Thank you for the sample project, I'm able to reproduce the issue you're describing. ... within VS) and found the same results: when I linked both the Dll and the ... I have a function in a dll that throws an exception of type class CEx. ... the application crashes as well ...
    (microsoft.public.windowsce.embedded.vc)
  • Global Assembly Cache Issue
    ... I have a dll that I use in several projects, that I placed in the Global ... you can see in the Exception below). ... If I change the Copy Local property of the reference to True, ... Attempting download of new URL ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: (Re)throwing from a catch block across dll boundaries
    ... If you encounter the problems described in this thread, check your compiler settings and change Code Generation/Runtime Library to 'Multi- threaded Debug DLL ' and 'Multi- threaded DLL '. ... I have a function in a dll that throws an exception of type class CEx. ... the application crashes as well ...
    (microsoft.public.windowsce.embedded.vc)