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. Using COM classes

Using COM classes

Scheduled Pinned Locked Moved C#
questioncsharpc++comhelp
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.
  • _ Offline
    _ Offline
    _Magnus_
    wrote on last edited by
    #1

    I tried to do some C# for the first time and decided to try and use one of my C++ COM classes from it. Using the class from C# gives this definition of a method. MyInterface1.A(out MyInterface2 ppIFace) Trying to call it as this will fail with a syntax error. MyInterface2 IFace2; MyInterface1 IFace1; IFace1.A(IFace2) How do i call this method from C# ? /Magnus


    - I don't necessarily agree with everything I say

    M 1 Reply Last reply
    0
    • _ _Magnus_

      I tried to do some C# for the first time and decided to try and use one of my C++ COM classes from it. Using the class from C# gives this definition of a method. MyInterface1.A(out MyInterface2 ppIFace) Trying to call it as this will fail with a syntax error. MyInterface2 IFace2; MyInterface1 IFace1; IFace1.A(IFace2) How do i call this method from C# ? /Magnus


      - I don't necessarily agree with everything I say

      M Offline
      M Offline
      mav northwind
      wrote on last edited by
      #2

      With C# you'll have to specify if a parameter is a ref or out parameter not only at the method declaration but at every call. So writing

      IFace1.A(out IFace2);

      should do the trick. Regards, mav

      _ 1 Reply Last reply
      0
      • M mav northwind

        With C# you'll have to specify if a parameter is a ref or out parameter not only at the method declaration but at every call. So writing

        IFace1.A(out IFace2);

        should do the trick. Regards, mav

        _ Offline
        _ Offline
        _Magnus_
        wrote on last edited by
        #3

        Oh..that simple, thanks. :) /Magnus


        - I don't necessarily agree with everything I say

        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