Often with a class you want the application to use structures or variables that can be passed to the classes functions to be read or written with data. There is no real difference between a class or structure in c++.NET so create the structure as a class.

In the header file of a class create this before the the main class’s ref class MyClassName (must be before so you can reference the class names in the main class)

	//------------------------------------------
	//----- CLASSES FOR CONFIGURATION DATA -----
	//------------------------------------------
	public ref class MyStructureClassName
	{
	public:
		property int Connection;		//Define the variables types here
		property String ^Name;
		property array ^Type;
		property array ^IpAddress;

		MyStructureClassName::MyStructureClassName(void)
		{
			//Strings and arrays will be nullptr until created
			Name = "";
			Type = gcnew array(NUM_OF_CONTROLLERS);	//Create them in a constructor
			IpAddress = gcnew array(NUM_OF_CONTROLLERS);
		}

	};

	//Now your main class...
	//-------------------------------
	//----- CONFIGURATION CLASS -----
	//-------------------------------
	ref class Configuration
	{
	The main class
In your main application

//IN YOUR DECLARATIONS:
//	private: MyClassNamespace::MyStructureClassName ^MyStructure1;
//IN YOUR CONSTRUCTOR
//	MyStructure1= gcnew MyClassNamespace::MyStructureClassName();
//START USING
//	MyStructure1-># = #;

Serializing A Class

See in serialization section here

USEFUL?
We benefit hugely from resources on the web so we decided we should try and give back some of our knowledge and resources to the community by opening up many of our company’s internal notes and libraries through mini sites like this. We hope you find the site helpful.
Please feel free to comment if you can add help to this page or point out issues and solutions you have found, but please note that we do not provide support on this site. If you need help with a problem please use one of the many online forums.