I solve the problem. I rewrite my COM using ATL. Now everyting is ok.
"Vasil Buraliev" <vasil_buraliev@yahoo.com> wrote in message
news:%238qH%23vAgGHA.3900@TK2MSFTNGP05.phx.gbl...
> 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. >
> ************************************************************************
>