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. COM Interop problem

COM Interop problem

Scheduled Pinned Locked Moved C#
comcsharphelpquestion
2 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.
  • J Offline
    J Offline
    Jose Vicente
    wrote on last edited by
    #1

    Hello. I'm using an ActiveX Control in my .NET project and I have to use a method that originally accepted a IStream. The .NET type library importer has modified the parameter of this method and now looks like this Interop::MyActiveXControl::IStream. The problem that I have is that I can't create directly a Interop::MyActiveXControl::IStream because this is an interface. I have created a System::IO::MemoryStream and fill it with data but this type can't be converted ( or I don't know how ) to convert to Interop::MyActiveXControl::IStream. Any ideas ?? Thanks in advance.

    H 1 Reply Last reply
    0
    • J Jose Vicente

      Hello. I'm using an ActiveX Control in my .NET project and I have to use a method that originally accepted a IStream. The .NET type library importer has modified the parameter of this method and now looks like this Interop::MyActiveXControl::IStream. The problem that I have is that I can't create directly a Interop::MyActiveXControl::IStream because this is an interface. I have created a System::IO::MemoryStream and fill it with data but this type can't be converted ( or I don't know how ) to convert to Interop::MyActiveXControl::IStream. Any ideas ?? Thanks in advance.

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      Create a new class and implement that interface. There won't be a class generated for it because the parameter is an interface, unless your COM library exposed a class that already implements it elsewhere.

      -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

      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