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. Managed C++/CLI
  4. Indexers, MC++ and C#

Indexers, MC++ and C#

Scheduled Pinned Locked Moved Managed C++/CLI
csharpc++databasedotnet
4 Posts 3 Posters 12 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
    sultan_of_6string
    wrote on last edited by
    #1

    Hi! I'm writing a cross-platform app using the .NET framework. The bulk of my program is in C# but for performance reasons, I'm had to implement a bit in Managed C++. My Managed C++ .dll includes a class that implements the IList interface: ... __property virtual bool get_IsReadOnly(); __property virtual Object* get_Item(int index); __property virtual void set_Item(int index, Object* value); virtual int Add(Object* value); etc. So, the get_Item/set_Item properties above appear as the Item property in VB.NET and MC++. In C#, it should appear as an indexer (object this[int index]). However, what I get is two methods called get_Item and set_Item. What's wrong?

    N 1 Reply Last reply
    0
    • S sultan_of_6string

      Hi! I'm writing a cross-platform app using the .NET framework. The bulk of my program is in C# but for performance reasons, I'm had to implement a bit in Managed C++. My Managed C++ .dll includes a class that implements the IList interface: ... __property virtual bool get_IsReadOnly(); __property virtual Object* get_Item(int index); __property virtual void set_Item(int index, Object* value); virtual int Add(Object* value); etc. So, the get_Item/set_Item properties above appear as the Item property in VB.NET and MC++. In C#, it should appear as an indexer (object this[int index]). However, what I get is two methods called get_Item and set_Item. What's wrong?

      N Offline
      N Offline
      Nish Nishant
      wrote on last edited by
      #2

      This problem has been reported a few days ago in this same forum by someone else. Apparently MC++ collections are not accessible through C# indexers. I haven't tried it out yet. Nish


      Author of the romantic comedy Summer Love and Some more Cricket [New Win] Buy it, read it and admire me :-)

      J 1 Reply Last reply
      0
      • N Nish Nishant

        This problem has been reported a few days ago in this same forum by someone else. Apparently MC++ collections are not accessible through C# indexers. I haven't tried it out yet. Nish


        Author of the romantic comedy Summer Love and Some more Cricket [New Win] Buy it, read it and admire me :-)

        J Offline
        J Offline
        James T Johnson
        wrote on last edited by
        #3

        Its not just MC++ collections that can't be accessible through C# indexers; its that MC++ indexers don't come up in C# as indexers. I can't figure out why that is; because I haven't looked into it much; maybe I'll revisit that issue now :) James

        N 1 Reply Last reply
        0
        • J James T Johnson

          Its not just MC++ collections that can't be accessible through C# indexers; its that MC++ indexers don't come up in C# as indexers. I can't figure out why that is; because I haven't looked into it much; maybe I'll revisit that issue now :) James

          N Offline
          N Offline
          Nish Nishant
          wrote on last edited by
          #4

          James T. Johnson wrote: Its not just MC++ collections that can't be accessible through C# indexers; its that MC++ indexers don't come up in C# as indexers. I can't figure out why that is; because I haven't looked into it much; maybe I'll revisit that issue now Puzzling!!! Nish :suss:


          Author of the romantic comedy Summer Love and Some more Cricket [New Win] Buy it, read it and admire me :-)

          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