Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. System.InvalidCastException Query

System.InvalidCastException Query

Scheduled Pinned Locked Moved C#
helpquestioncsharpdatabasecom
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DwR
    wrote on last edited by
    #1

    Hi, I am passing a VBScript Object to a C# assembly and am getting the following error output: "Unable to cast COM object of type 'Agents.AgentClass' to interface type 'Agents._Agent'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{315DF678-45D7-4A60-9A50-C9E83672A5E5}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE))." I'd appreciate it if someone can explain what is going on here and how I can fix it? I am confused... Note: I have tried changing the method header to accept type Agents._Agent but that causing the method call in vbscript to fail completely. Changing the type to Agents.Agent (another available type) generates a similar error. Kind Regards, Dave

    Regards, Dave

    D L 2 Replies Last reply
    0
    • D DwR

      Hi, I am passing a VBScript Object to a C# assembly and am getting the following error output: "Unable to cast COM object of type 'Agents.AgentClass' to interface type 'Agents._Agent'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{315DF678-45D7-4A60-9A50-C9E83672A5E5}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE))." I'd appreciate it if someone can explain what is going on here and how I can fix it? I am confused... Note: I have tried changing the method header to accept type Agents._Agent but that causing the method call in vbscript to fail completely. Changing the type to Agents.Agent (another available type) generates a similar error. Kind Regards, Dave

      Regards, Dave

      D Offline
      D Offline
      DwR
      wrote on last edited by
      #2

      Hi, I see there's no reply to this. Do I need to provide more information?

      Regards, Dave

      1 Reply Last reply
      0
      • D DwR

        Hi, I am passing a VBScript Object to a C# assembly and am getting the following error output: "Unable to cast COM object of type 'Agents.AgentClass' to interface type 'Agents._Agent'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{315DF678-45D7-4A60-9A50-C9E83672A5E5}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE))." I'd appreciate it if someone can explain what is going on here and how I can fix it? I am confused... Note: I have tried changing the method header to accept type Agents._Agent but that causing the method call in vbscript to fail completely. Changing the type to Agents.Agent (another available type) generates a similar error. Kind Regards, Dave

        Regards, Dave

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        That error indicates that it doesn't know what an Agent is. I assume that it's correctly installed, registered, and that you can create an agent using VBScript. Does the C# assembly have references to the correct versions of the AgentObjects.dll and AxAgentObjects.dll?

        I are Troll :suss:

        F 1 Reply Last reply
        0
        • L Lost User

          That error indicates that it doesn't know what an Agent is. I assume that it's correctly installed, registered, and that you can create an agent using VBScript. Does the C# assembly have references to the correct versions of the AgentObjects.dll and AxAgentObjects.dll?

          I are Troll :suss:

          F Offline
          F Offline
          FenixTX
          wrote on last edited by
          #4

          [^] This Might be helpful for you

          L 1 Reply Last reply
          0
          • F FenixTX

            [^] This Might be helpful for you

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            You replied to the wrong post - the TS would have gotten an email-notification if you'd replied on the original question :)

            I are Troll :suss:

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups