Strange Problem

Hello there guys !

I m new here, and almost "new" to C++ ( Managed )
I created new project ( Standart CLR Application ) from scratch.
This project is just for learning and testing purposes.

So my code is following :

Chat_Client.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "FileManager.h"
#include "PropertyManager.h"

void main()
{
	FileManager::Config FileManager_Config;
	PropertyManager::Language PropertyManager_Language;

	if ( FileManager_Config.Verify() == true )
	{
		FileManager_Config.LoadAllValues();
	}

	System::Windows::Forms::MessageBox::Show( PropertyManager_Language.GetName() , "TEST" );
}


FileManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once

#include "PropertyManager.h"

using namespace System;
using namespace System::IO;

namespace FileManager
{

	public ref class Config
	{

	public:

		PropertyManager::Language PropertyManager_Language;

		bool Verify()
		{
			return File::Exists( PropertyManager::StaticVariables::ConfigFile );
		}

		void LoadAllValues()
		{
			StreamReader^ _File = gcnew StreamReader( PropertyManager::StaticVariables::ConfigFile );
			String^ tmp_Data;
			int x = 1;
			while ( ( tmp_Data = _File->ReadLine()) != nullptr )
			{
				if ( tmp_Data->StartsWith("Language=") )
				{
					PropertyManager_Language.SetName( tmp_Data->Replace( "Language=" , "") );
				}
				x++;
			}
			_File->Close();
		}

	};

}


PropertyManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#pragma once

using namespace System;

namespace PropertyManager
{

	public ref struct StaticVariables
	{

	public:

		static String^ ConfigFile = "Config.ini";
		static String^ Version = "(beta)";

	};

	public ref class Language
	{

	public:

		void SetName( String^ _Name)
		{
			Name = _Name;
		}

		String^ GetName()
		{
			return Name;
		}

		void LoadAllStrings()
		{
		}

	private:

		String^ Name;

	};

}


Everything is compiled without any problems or warnings.
Application also runs ok .. but the problem is that String called Name inside Language class wont change
It still shows that Language Name is "empty"

Anyone can help me with this ?
Thx for advice
Last edited on
Topic archived. No new replies allowed.