Problems using a com object in asp.net

Ask a Question related to ASP Components, Design and Development.

  1. #1

    Default Problems using a com object in asp.net

    I am trying to use some com objects in .net that we have been using in ASP
    Classic for quite some time now. I have follow the reading on how to add a
    reference to the com object from Visual Studio and that does create a new
    interop dll and place it in the bin directory. I can then access the methods
    of the object through intellisense and everything compiles and looks like it
    will run great. Then I actually run the program and receive the following
    error.

    Unable to cast COM object of type 'Namespace.TestClass' to interface type
    'Namespace._Test'. This operation failed because the QueryInterface call on
    the COM component for the interface with IID
    '{9D2930FF-B15F-4047-8C28-1DF43362A34F}' failed due to the following error:
    No such interface supported (Exception from HRESULT: 0x80004002
    (E_NOINTERFACE)).

    The code I used to produce this error is as follows:

    Namespace.TestClass moTest = new Namespace.TestClass();
    moTest.Load("OM005", "EN");

    The error is thrown on the second line.

    Any help on a resolution for this issue would be greatly appreciated. I am
    using VS 2005.

    Thanks
    Billse Guest

  2. Similar Questions and Discussions

    1. Having problems with shared object
      Hi all, Presently i am dealing with a project which gives option to its user of recording their own voice on a popular songs music. Something like...
    2. Problems returning an array in an object - Web Service
      Ole Mugaas via .NET 247 <anonymous@dotnet247.com> wrote in news:OvAvlsUWFHA.2796@TK2MSFTNGP09.phx.gbl: Objects cant be returned over a soap...
    3. as to java object -serializing problems
      I can get an simple object. deserializing. no problems i made an updateCustomer(Customer cus) in my java object , this method will store my...
    4. aspUpload and File object problems??
      I'm thinking this has something to do with data type but I'm not sure. All I'm trying to do here is upload media to the server using aspUpload then...
    5. Problems creating FDF object
      Using Java, I have a fillable PDF that when the user submits, the FDF output stream is caught, coverted to string and then written to a file. The...
  3. #2

    Default Re: Problems using a com object in asp.net


    "Billse" <Billse@discussions.microsoft.com> wrote in message
    news:DFFB3C4D-DD2C-49AD-8D6D-90D68798BAF8@microsoft.com...
    > I am trying to use some com objects in .net that we have been using in ASP
    > Classic for quite some time now. I have follow the reading on how to add
    a
    > reference to the com object from Visual Studio and that does create a new
    > interop dll and place it in the bin directory. I can then access the
    methods
    > of the object through intellisense and everything compiles and looks like
    it
    > will run great. Then I actually run the program and receive the following
    > error.
    >
    > Unable to cast COM object of type 'Namespace.TestClass' to interface type
    > 'Namespace._Test'. This operation failed because the QueryInterface call
    on
    > the COM component for the interface with IID
    > '{9D2930FF-B15F-4047-8C28-1DF43362A34F}' failed due to the following
    error:
    > No such interface supported (Exception from HRESULT: 0x80004002
    > (E_NOINTERFACE)).
    >
    > The code I used to produce this error is as follows:
    >
    > Namespace.TestClass moTest = new Namespace.TestClass();
    > moTest.Load("OM005", "EN");
    >
    > The error is thrown on the second line.
    >
    > Any help on a resolution for this issue would be greatly appreciated. I
    am
    > using VS 2005.
    >
    Sounds like you need to to rebuild the inter-op assembly. However this NG
    is for classic ASP try an appropriate dotnet NG instead.
    > Thanks

    Anthony Jones Guest

  4. #3

    Default Re: Problems using a com object in asp.net

    I'm actually having the same problem. It worked fine in .Net 1.1, but when we upgraded to .Net 2.0 I get errors. Here's the code:

    Dim objUser As TSUSEREXLib.ADsTSUserEx = Nothing
    Dim strUserPath As String = String.Empty
    Try

    strUserPath = User.Path
    objUser = CType(GetObject(strUserPath), TSUSEREXLib.ADsTSUserEx)
    If Not objUser Is Nothing Then
    objUser.GetInfo()
    If _TerminalServices Is Nothing Then
    _TerminalServices = New AD.adTerminalServicesOptions
    End If
    _TerminalServices.ProfilePath = objUser.TerminalServicesProfilePath.ToString


    End If
    Catch ex As Exception
    end try

    Here's the error message:
    {"Unable to cast COM object of type 'System.__ComObject' to interface type 'TSUSEREXLib.ADsTSUserEx'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{C4930E79-2989-4462-8A60-2FCF2F2955EF}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE))."} System.Exception

    I can find the component in my registry, the interop is in the bin directory. And I forced .net to rebuild the interop by removing and re-adding the reference. And, as I said earlier, the exact same code runs in .Net 1.1.

    Any help would be greatly appreciated.

    Candi
    ---
    Posted via DotNetSlackers.com
    csuriano@csgai.com Guest

  5. #4

    Default Re: Problems using a com object in asp.net


    <csuriano@csgai.com> wrote in message
    news:OhHWIvJ9GHA.3960@TK2MSFTNGP05.phx.gbl...
    > I'm actually having the same problem. It worked fine in .Net 1.1, but when
    we upgraded to .Net 2.0 I get errors. Here's the code:
    >
    > Dim objUser As TSUSEREXLib.ADsTSUserEx = Nothing
    > Dim strUserPath As String = String.Empty
    > Try
    >
    > strUserPath = User.Path
    > objUser = CType(GetObject(strUserPath), TSUSEREXLib.ADsTSUserEx)
    > If Not objUser Is Nothing Then
    > objUser.GetInfo()
    > If _TerminalServices Is Nothing Then
    > _TerminalServices = New AD.adTerminalServicesOptions
    > End If
    > _TerminalServices.ProfilePath =
    objUser.TerminalServicesProfilePath.ToString
    >
    >
    > End If
    > Catch ex As Exception
    > end try
    >
    > Here's the error message:
    > {"Unable to cast COM object of type 'System.__ComObject' to interface type
    'TSUSEREXLib.ADsTSUserEx'. This operation failed because the QueryInterface
    call on the COM component for the interface with IID
    '{C4930E79-2989-4462-8A60-2FCF2F2955EF}' failed due to the following error:
    No such interface supported (Exception from HRESULT: 0x80004002
    (E_NOINTERFACE))."} System.Exception
    >
    > I can find the component in my registry, the interop is in the bin
    directory. And I forced .net to rebuild the interop by removing and
    re-adding the reference. And, as I said earlier, the exact same code runs in
    ..Net 1.1.
    >
    > Any help would be greatly appreciated.
    >
    You might get more more help if you followed the advice I had already given
    to the OP. Ask in an appropriate .NET group, this is for classic ASP.
    > Candi
    > ---
    > Posted via DotNetSlackers.com

    Anthony Jones Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139