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. "out keyword" in COM interop

"out keyword" in COM interop

Scheduled Pinned Locked Moved C#
helpcomcsharpvisual-studioquestion
3 Posts 2 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.
  • S Offline
    S Offline
    slnarasimhan
    wrote on last edited by
    #1

    Hi, I have a problem with passing parameters to a method in a COM , i had imported to my C# application using the IDE add reference. This is because the parameter has type as "out object", when i tried passing an Object (reference) to this, the error is "invalid arguments". Can anybody please help me out on this?? Yours Truly SLN

    B 1 Reply Last reply
    0
    • S slnarasimhan

      Hi, I have a problem with passing parameters to a method in a COM , i had imported to my C# application using the IDE add reference. This is because the parameter has type as "out object", when i tried passing an Object (reference) to this, the error is "invalid arguments". Can anybody please help me out on this?? Yours Truly SLN

      B Offline
      B Offline
      Burt Harris
      wrote on last edited by
      #2

      You probably just need to add the "out" keyword to your function call, just before the variable name. void foo( YourComObject com ) { object o; com.GetXyz( out o ); ... } Burt Harris

      S 1 Reply Last reply
      0
      • B Burt Harris

        You probably just need to add the "out" keyword to your function call, just before the variable name. void foo( YourComObject com ) { object o; com.GetXyz( out o ); ... } Burt Harris

        S Offline
        S Offline
        slnarasimhan
        wrote on last edited by
        #3

        Thanks it worked!!! :) Yours Truly SLN

        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