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. mixed types are not supported

mixed types are not supported

Scheduled Pinned Locked Moved Managed C++/CLI
c++helpquestion
4 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.
  • T Offline
    T Offline
    transoft
    wrote on last edited by
    #1

    Hi, I need to use "not Managed C++/CLI class" in a Managed C++/CLI class. But I got the "not supported" error message. Is there a way to do following? -------------------------------------- class A (){}; public ref class B() { A a; <----- not supported } ------------------------- Thanks

    M 1 Reply Last reply
    0
    • T transoft

      Hi, I need to use "not Managed C++/CLI class" in a Managed C++/CLI class. But I got the "not supported" error message. Is there a way to do following? -------------------------------------- class A (){}; public ref class B() { A a; <----- not supported } ------------------------- Thanks

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      You could store a pointer to an "A" object in an IntPtr[^].

      Mark Salsbery :java:

      T 1 Reply Last reply
      0
      • M Mark Salsbery

        You could store a pointer to an "A" object in an IntPtr[^].

        Mark Salsbery :java:

        T Offline
        T Offline
        transoft
        wrote on last edited by
        #3

        Thank you very much for the reply. Could you write some sample code? Best,

        M 1 Reply Last reply
        0
        • T transoft

          Thank you very much for the reply. Could you write some sample code? Best,

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          Just a guess, something like...

          class A (){};

          ref class B()
          {
          public:
          IntPtr APtr;
          }

          B ^b = gcnew B();
          b->APtr = (IntPtr)new A();
          A *a = (A*)b->APtr;

          Mark Salsbery :java:

          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