Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4029990
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:24:55+00:00 2026-05-20T11:24:55+00:00

Say I’ve got a class like the following: public ref class MyClass {}; I

  • 0

Say I’ve got a class like the following:

public ref class MyClass {};

I would like to have a vector of objects of such a class:

cliext::vector<MyClass ^> ^myVector;

I understand that this is a vector of handles to reference types, isn’t it? I mean, this is not a vector of reference types, so I don’t need to define any of these requirements:

Requirements for STL/CLR Container Elements

These requirements would be necessary in case I defined cliext::vector<MyClass> ^myVector, because then a copy of each element would be stored in the container and blah blah.

Is all this right? Because I’m getting a NullReferenceException when I retrieve an element from the vector. I can see the object is properly constructed, but when I get it back from the vector all its members are undefined.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T11:24:55+00:00Added an answer on May 20, 2026 at 11:24 am

    The STL/CLR library was delivered very late, three years after the original promised shipping date. It was quickly obvious to everybody why, it combined all the disadvantages of the native C++ container classes with the disadvantages of managed memory management. There is no upside, the library doesn’t have a single redeeming value. Its compatibility with the C++ classes is only a liability, preventing you from doing the right thing. Review this page for the horror story.

    Do not invest any of your time in making this work, it is utterly wasted effort. Use the classes in the System::Collections::Generic namespace.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have a class named Frog, it looks like: public class Frog {
Say we have the following method: private MyObject foo = new MyObject(); // and
Say I have the following file structure: app/ app.py controllers/ __init__.py project.py plugin.py If
Say I have a Student table, it's got an int ID. I have a
Say you have an application divided into 3-tiers: GUI, business logic, and data access.
Say I've got this array: MyArray(0)=aaa MyArray(1)=bbb MyArray(2)=aaa Is there a .net function which
Say I have an ASMX web service, MyService. The service has a method, MyMethod.
Say I have three files (template_*.txt): template_x.txt template_y.txt template_z.txt I want to copy them
Say I have two strings, String s1 = AbBaCca; String s2 = bac; I
Say a development team includes (or makes use of) graphic artists who create all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.