Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

I have several custom classes in a C# project that I then reference in a C++ project. The C# code looks something like this

namespace AllOptions { public class AllOptions { public AlgorithmOptions algOptions{ get; set; } public DatabaseOptions dataOptions{ get; set; } } public class AlgorithmOptions { List<Algorithm> algorithms { get; set; } public void SetDefaults(){ this.algorithms.Clear(); } } public class Algorithm { public bool AllowSalt { get; set; } } public class DatabaseOptions { public List<string> databaseSrouces { get; set; } } } 

And then from C++ I am trying to access the various parts of the AllOptions but not all of them are coming through.

//Is declared at the beginning public: VerifyOptions::VerifyOptions Options; //Then later on I try to access the database options and algorithm options this->Options.databaseOptions->databaseSources = someStringList; //works fine //This cannot find the algorithm list this->Options.algorithmOptions->algorithms = someAlgorithmList; //does not work 

The algorithms says "Class AllOptions::AlgorithmOptions has no member algorithms". Why can't the C++ code see this particular C# member?

EDIT My question was tagged as a possible duplicate to this Default access modifier in C#Default access modifier in C# question. However I believe these to be different questions that happened to result in the same answer. If I am wrong in thinking that please tag it again and I will change it.

I have several custom classes in a C# project that I then reference in a C++ project. The C# code looks something like this

namespace AllOptions { public class AllOptions { public AlgorithmOptions algOptions{ get; set; } public DatabaseOptions dataOptions{ get; set; } } public class AlgorithmOptions { List<Algorithm> algorithms { get; set; } public void SetDefaults(){ this.algorithms.Clear(); } } public class Algorithm { public bool AllowSalt { get; set; } } public class DatabaseOptions { public List<string> databaseSrouces { get; set; } } } 

And then from C++ I am trying to access the various parts of the AllOptions but not all of them are coming through.

//Is declared at the beginning public: VerifyOptions::VerifyOptions Options; //Then later on I try to access the database options and algorithm options this->Options.databaseOptions->databaseSources = someStringList; //works fine //This cannot find the algorithm list this->Options.algorithmOptions->algorithms = someAlgorithmList; //does not work 

The algorithms says "Class AllOptions::AlgorithmOptions has no member algorithms". Why can't the C++ code see this particular C# member?

EDIT My question was tagged as a possible duplicate to this Default access modifier in C# question. However I believe these to be different questions that happened to result in the same answer. If I am wrong in thinking that please tag it again and I will change it.

I have several custom classes in a C# project that I then reference in a C++ project. The C# code looks something like this

namespace AllOptions { public class AllOptions { public AlgorithmOptions algOptions{ get; set; } public DatabaseOptions dataOptions{ get; set; } } public class AlgorithmOptions { List<Algorithm> algorithms { get; set; } public void SetDefaults(){ this.algorithms.Clear(); } } public class Algorithm { public bool AllowSalt { get; set; } } public class DatabaseOptions { public List<string> databaseSrouces { get; set; } } } 

And then from C++ I am trying to access the various parts of the AllOptions but not all of them are coming through.

//Is declared at the beginning public: VerifyOptions::VerifyOptions Options; //Then later on I try to access the database options and algorithm options this->Options.databaseOptions->databaseSources = someStringList; //works fine //This cannot find the algorithm list this->Options.algorithmOptions->algorithms = someAlgorithmList; //does not work 

The algorithms says "Class AllOptions::AlgorithmOptions has no member algorithms". Why can't the C++ code see this particular C# member?

EDIT My question was tagged as a possible duplicate to this Default access modifier in C# question. However I believe these to be different questions that happened to result in the same answer. If I am wrong in thinking that please tag it again and I will change it.

explained non-duplicate
Source Link
WWZee
  • 497
  • 2
  • 8
  • 23

I have several custom classes in a C# project that I then reference in a C++ project. The C# code looks something like this

namespace AllOptions { public class AllOptions { public AlgorithmOptions algOptions{ get; set; } public DatabaseOptions dataOptions{ get; set; } } public class AlgorithmOptions { List<Algorithm> algorithms { get; set; } public void SetDefaults(){ this.algorithms.Clear(); } } public class Algorithm { public bool AllowSalt { get; set; } } public class DatabaseOptions { public List<string> databaseSrouces { get; set; } } } 

And then from C++ I am trying to access the various parts of the AllOptions but not all of them are coming through.

//Is declared at the beginning public: VerifyOptions::VerifyOptions Options; //Then later on I try to access the database options and algorithm options this->Options.databaseOptions->databaseSources = someStringList; //works fine //This cannot find the algorithm list this->Options.algorithmOptions->algorithms = someAlgorithmList; //does not work 

The algorithms says "Class AllOptions::AlgorithmOptions has no member algorithms". Why can't the C++ code see this particular C# member?

EDIT My question was tagged as a possible duplicate to this Default access modifier in C# question. However I believe these to be different questions that happened to result in the same answer. If I am wrong in thinking that please tag it again and I will change it.

I have several custom classes in a C# project that I then reference in a C++ project. The C# code looks something like this

namespace AllOptions { public class AllOptions { public AlgorithmOptions algOptions{ get; set; } public DatabaseOptions dataOptions{ get; set; } } public class AlgorithmOptions { List<Algorithm> algorithms { get; set; } public void SetDefaults(){ this.algorithms.Clear(); } } public class Algorithm { public bool AllowSalt { get; set; } } public class DatabaseOptions { public List<string> databaseSrouces { get; set; } } } 

And then from C++ I am trying to access the various parts of the AllOptions but not all of them are coming through.

//Is declared at the beginning public: VerifyOptions::VerifyOptions Options; //Then later on I try to access the database options and algorithm options this->Options.databaseOptions->databaseSources = someStringList; //works fine //This cannot find the algorithm list this->Options.algorithmOptions->algorithms = someAlgorithmList; //does not work 

The algorithms says "Class AllOptions::AlgorithmOptions has no member algorithms". Why can't the C++ code see this particular C# member?

I have several custom classes in a C# project that I then reference in a C++ project. The C# code looks something like this

namespace AllOptions { public class AllOptions { public AlgorithmOptions algOptions{ get; set; } public DatabaseOptions dataOptions{ get; set; } } public class AlgorithmOptions { List<Algorithm> algorithms { get; set; } public void SetDefaults(){ this.algorithms.Clear(); } } public class Algorithm { public bool AllowSalt { get; set; } } public class DatabaseOptions { public List<string> databaseSrouces { get; set; } } } 

And then from C++ I am trying to access the various parts of the AllOptions but not all of them are coming through.

//Is declared at the beginning public: VerifyOptions::VerifyOptions Options; //Then later on I try to access the database options and algorithm options this->Options.databaseOptions->databaseSources = someStringList; //works fine //This cannot find the algorithm list this->Options.algorithmOptions->algorithms = someAlgorithmList; //does not work 

The algorithms says "Class AllOptions::AlgorithmOptions has no member algorithms". Why can't the C++ code see this particular C# member?

EDIT My question was tagged as a possible duplicate to this Default access modifier in C# question. However I believe these to be different questions that happened to result in the same answer. If I am wrong in thinking that please tag it again and I will change it.

Source Link
WWZee
  • 497
  • 2
  • 8
  • 23

Why can't my C++ code see this C# class member?

I have several custom classes in a C# project that I then reference in a C++ project. The C# code looks something like this

namespace AllOptions { public class AllOptions { public AlgorithmOptions algOptions{ get; set; } public DatabaseOptions dataOptions{ get; set; } } public class AlgorithmOptions { List<Algorithm> algorithms { get; set; } public void SetDefaults(){ this.algorithms.Clear(); } } public class Algorithm { public bool AllowSalt { get; set; } } public class DatabaseOptions { public List<string> databaseSrouces { get; set; } } } 

And then from C++ I am trying to access the various parts of the AllOptions but not all of them are coming through.

//Is declared at the beginning public: VerifyOptions::VerifyOptions Options; //Then later on I try to access the database options and algorithm options this->Options.databaseOptions->databaseSources = someStringList; //works fine //This cannot find the algorithm list this->Options.algorithmOptions->algorithms = someAlgorithmList; //does not work 

The algorithms says "Class AllOptions::AlgorithmOptions has no member algorithms". Why can't the C++ code see this particular C# member?