Com Exception from .Net Application.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?a2FyaW0=?=

    Com Exception from .Net Application.

    Hi,

    My .Net application call a COM Class method. The signature of COm method is
    object get_Item(ref object Key);
    This method had defined in "NCR.APTRA.AXFS " namespace

    and I Have "formList" of Type "NCR.APTRA.AXFS .IXFSDictionary "

    Here i am getting an exception with the below statement
    NCR.APTRA.AXFS. XFSGenericPrint Form formObj =
    (NCR.APTRA.AXFS .XFSGenericPrin tForm)formList. get_Item(ref formNameObject) ;

    Exception Details:
    ===========
    Unable to cast COM object of type 'System.__ComOb ject' to interface type
    'NCR.APTRA.AXFS .XFSGenericPrin tForm'. This operation failed because the
    QueryInterface call on the COM component for the interface with IID
    '{B9EEACF8-6552-4E85-9069-D58160BC40FF}' failed due to the following error:
    No such interface supported (Exception from HRESULT: 0x80004002
    (E_NOINTERFACE) ).

    Please can anyone help me to resolve.

    Thanks & Regards,
    Karimulla.
  • Aneesh Pulukkul [http://dotnet-revolutions.blogspo

    #2
    Re: Com Exception from .Net Application.

    On May 26, 8:41 pm, karim <ka...@discussi ons.microsoft.c omwrote:
    Hi,
    >
    My .Net application call a COM Class method. The signature of COm method is
    object get_Item(ref object Key);
    This method had defined in "NCR.APTRA.AXFS " namespace
    >
    and I Have "formList" of Type "NCR.APTRA.AXFS .IXFSDictionary "
    >
    Here i am getting an exception with the below statement
    NCR.APTRA.AXFS. XFSGenericPrint Form formObj =
    (NCR.APTRA.AXFS .XFSGenericPrin tForm)formList. get_Item(ref formNameObject) ;
    >
    Exception Details:
    ===========
    Unable to cast COM object of type 'System.__ComOb ject' to interface type
    'NCR.APTRA.AXFS .XFSGenericPrin tForm'. This operation failed because the
    QueryInterface call on the COM component for the interface with IID
    '{B9EEACF8-6552-4E85-9069-D58160BC40FF}' failed due to the following error:
    No such interface supported (Exception from HRESULT: 0x80004002
    (E_NOINTERFACE) ).
    >
    Please can anyone help me to resolve.
    >
    Thanks & Regards,
    Karimulla.
    NCR.APTRA.AXFS. XFSGenericPrint Form is a .Net type? If yes we can't
    cast to __ComObject. Else we can re-register the COM dll and try again.

    Comment

    • =?Utf-8?B?a2FyaW0=?=

      #3
      Re: Com Exception from .Net Application.

      Yes, NCR.APTRA.AXFS. XFSGenericPrint Form is a .Net type.
      Here the COM get_Item method has a return type Object, which i am capturing
      in .Net object of type "NCR.APTRA.AXFS .XFSGenericPrin tForm".
      Can you pls tell me how do we handle COM call from .Net application?

      Regards,
      Karimulla.

      "Aneesh Pulukkul [http://dotnet-revolutio" wrote:
      On May 26, 8:41 pm, karim <ka...@discussi ons.microsoft.c omwrote:
      Hi,

      My .Net application call a COM Class method. The signature of COm method is
      object get_Item(ref object Key);
      This method had defined in "NCR.APTRA.AXFS " namespace

      and I Have "formList" of Type "NCR.APTRA.AXFS .IXFSDictionary "

      Here i am getting an exception with the below statement
      NCR.APTRA.AXFS. XFSGenericPrint Form formObj =
      (NCR.APTRA.AXFS .XFSGenericPrin tForm)formList. get_Item(ref formNameObject) ;

      Exception Details:
      ===========
      Unable to cast COM object of type 'System.__ComOb ject' to interface type
      'NCR.APTRA.AXFS .XFSGenericPrin tForm'. This operation failed because the
      QueryInterface call on the COM component for the interface with IID
      '{B9EEACF8-6552-4E85-9069-D58160BC40FF}' failed due to the following error:
      No such interface supported (Exception from HRESULT: 0x80004002
      (E_NOINTERFACE) ).

      Please can anyone help me to resolve.

      Thanks & Regards,
      Karimulla.
      >
      NCR.APTRA.AXFS. XFSGenericPrint Form is a .Net type? If yes we can't
      cast to __ComObject. Else we can re-register the COM dll and try again.
      >

      Comment

      • Leon Lambert

        #4
        Re: Com Exception from .Net Application.

        The way i have my C# components use COM is by using the tlbimp.exe tool.
        It will generate a wrapper assemble for the COM component so I can just
        use it in C#. Search your help for tlbimp.exe for examples on how to use it.

        Hope this helps
        Leon Lambert

        karim wrote:
        Yes, NCR.APTRA.AXFS. XFSGenericPrint Form is a .Net type.
        Here the COM get_Item method has a return type Object, which i am capturing
        in .Net object of type "NCR.APTRA.AXFS .XFSGenericPrin tForm".
        Can you pls tell me how do we handle COM call from .Net application?
        >
        Regards,
        Karimulla.
        >
        "Aneesh Pulukkul [http://dotnet-revolutio" wrote:
        >
        >On May 26, 8:41 pm, karim <ka...@discussi ons.microsoft.c omwrote:
        >>Hi,
        >>>
        >>My .Net application call a COM Class method. The signature of COm method is
        >>object get_Item(ref object Key);
        >>This method had defined in "NCR.APTRA.AXFS " namespace
        >>>
        >>and I Have "formList" of Type "NCR.APTRA.AXFS .IXFSDictionary "
        >>>
        >>Here i am getting an exception with the below statement
        >>NCR.APTRA.AXF S.XFSGenericPri ntForm formObj =
        >>(NCR.APTRA.AX FS.XFSGenericPr intForm)formLis t.get_Item(ref formNameObject) ;
        >>>
        >>Exception Details:
        >>===========
        >>Unable to cast COM object of type 'System.__ComOb ject' to interface type
        >>'NCR.APTRA.AX FS.XFSGenericPr intForm'. This operation failed because the
        >>QueryInterfac e call on the COM component for the interface with IID
        >>'{B9EEACF8-6552-4E85-9069-D58160BC40FF}' failed due to the following error:
        >>No such interface supported (Exception from HRESULT: 0x80004002
        >>(E_NOINTERFAC E)).
        >>>
        >>Please can anyone help me to resolve.
        >>>
        >>Thanks & Regards,
        >>Karimulla.
        >NCR.APTRA.AXFS .XFSGenericPrin tForm is a .Net type? If yes we can't
        >cast to __ComObject. Else we can re-register the COM dll and try again.
        >>

        Comment

        Working...