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. std::queue and Managed class

std::queue and Managed class

Scheduled Pinned Locked Moved Managed C++/CLI
c++csharpdata-structureshelpquestion
4 Posts 3 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.
  • V Offline
    V Offline
    Vadim Tabakman
    wrote on last edited by
    #1

    Hi all, I'm trying to do the following : std::queue m_qSomeName; but I get the following compile error ...\Vc7\include\deque(59): error C2847: cannot apply sizeof to managed type 'TestApp1::MyManagedClass' ok.. so I changed MyManagedClass to a non Managed Class, and now I get a different compile error: ...\TestApp1\MyServer.h(29): error C3633: cannot define 'm_qSomeName' as a member of managed 'TestApp1::MyServer' Now I'm just trying things out, but is it not possible to use the std::queue template class in managed c++? what about other STL classes? Before anyone says, why aren't you using .NET queue/list classes. I'm geniunely curious why I am not able to use STL Thanx :)

    P 1 Reply Last reply
    0
    • V Vadim Tabakman

      Hi all, I'm trying to do the following : std::queue m_qSomeName; but I get the following compile error ...\Vc7\include\deque(59): error C2847: cannot apply sizeof to managed type 'TestApp1::MyManagedClass' ok.. so I changed MyManagedClass to a non Managed Class, and now I get a different compile error: ...\TestApp1\MyServer.h(29): error C3633: cannot define 'm_qSomeName' as a member of managed 'TestApp1::MyServer' Now I'm just trying things out, but is it not possible to use the std::queue template class in managed c++? what about other STL classes? Before anyone says, why aren't you using .NET queue/list classes. I'm geniunely curious why I am not able to use STL Thanx :)

      P Offline
      P Offline
      palbano
      wrote on last edited by
      #2

      I have not tried to store managed object pointers in STL collections, I can imagine there could be many perils in that even if it was supported. I have used STL vector in a "mixed mode" exe project in VS 2003 std::vector<LPCTSTR> strV; So STL will compile and execute within a mixed mode project. But as you can see I was not mixing STL and Managed types.

      "No matter where you go, there your are." - Buckaroo Banzai

      -pete

      V 1 Reply Last reply
      0
      • P palbano

        I have not tried to store managed object pointers in STL collections, I can imagine there could be many perils in that even if it was supported. I have used STL vector in a "mixed mode" exe project in VS 2003 std::vector<LPCTSTR> strV; So STL will compile and execute within a mixed mode project. But as you can see I was not mixing STL and Managed types.

        "No matter where you go, there your are." - Buckaroo Banzai

        -pete

        V Offline
        V Offline
        Vadim Tabakman
        wrote on last edited by
        #3

        thanx for your reply Palbano, yeh i've been able to use standard objects in an stl vector but not managed ones. oh well. i can just live with out it. would have been nice to know though :) thanx If there's one thing I've learned, it's that life is one crushing defeat after another until you just wish Flanders was dead. - Homer Simpson

        A 1 Reply Last reply
        0
        • V Vadim Tabakman

          thanx for your reply Palbano, yeh i've been able to use standard objects in an stl vector but not managed ones. oh well. i can just live with out it. would have been nice to know though :) thanx If there's one thing I've learned, it's that life is one crushing defeat after another until you just wish Flanders was dead. - Homer Simpson

          A Offline
          A Offline
          adrian cooper
          wrote on last edited by
          #4

          check out this article over at codeguru which talks about mixing STL with the .NET Base Class Library. http://www.codeguru.com/columns/Kate/article.php/c4849/[^] ade me; while(myKitchen.beerInFridge()) { me.watchTV(); me.consumeBeer(myKitchen.getBeerCan()); }

          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