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



I solve the problem. I rewrite my COM using ATL. Now everyting is ok.

Ph.

"Vasil Buraliev" <vasil_buraliev@xxxxxxxxx> wrote in message
news:%238qH%23vAgGHA.3900@xxxxxxxxxxxxxxxxxxxxxxx
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

  • QueryInterface for interface * failed. (Using COM Interop dll in web application)
    ... I wrote a COM dll in Visual C++ 6.0 and MFC that generates some report. ... // log general exception ... of the browser. ... I can use com obj only first time when I make request to instantiate ...
    (microsoft.public.dotnet.framework.interop)
  • Re: Remote Debugging ASP.net 2.0 Web Service (no symbols loaded?)
    ... > interface via a browser, ... > (either return values or one line error messages - typically exception ... information in the HTTP response from these web methods, ...
    (microsoft.public.vsnet.debugging)
  • Re: HELP: Need to continue the loop after the exception
    ... def looptest ... The TimeOutException will happen when the browser doesn't return ... When this exception happens, the browser ... rescue in there) ...
    (comp.lang.ruby)
  • Re: Best Practice when trying to Load object from Data Layer when it doesnt find it
    ... The other browser then tries to do something with it and the code behind tries to load that record to save the new value into it and it no longer exists. ... With optimistic locking this is to be expected (and is not an exception). ... With optimistic locking you also need to check that the underlying record was not changed in the meantime by another user otherwise changes made by one user are written over by another user. ... object becaues it isnt' in the Db, should the data layer pass back an exception or a null reference? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Opening a browser window from a Window Form
    ... I've found the following registry keys that might be appropriate... ... I'm trying to open a web page in a browser. ... // botch - this gives an error if blocked by zonealarm or other firewall ... catch (Exception ex) ...
    (microsoft.public.dotnet.framework.windowsforms)