I’m creating a Windows Form application as a tool for website development. The initial form maintains a list of user defined website names paired with the local path to the files that make up the site. The path points to the base directory of the site and that base directory should contain certain sub-directories for use by the eventual process.

I’ve created a website class to maintain the data and path related to each website. This class implements IComparable so the list can be kept in alphabetic order:
website.h:

Code:
#pragma once
using namespace System;

ref class website  : public IComparable
{
public:
	website(void);
	website(String ^name, String ^path);
	bool operator < (website^);
	bool CheckDirectory();
	String^ domainName;
	String^ localPath;
	int pathCount;
	int clientFlag;
	int archiveFlag;
	int serverFlag;
	int webFlag;

	virtual Int32 CompareTo ( Object ^ obj)
	{
		website ^ other;
		other = (website ^)obj;
		if ( other == nullptr ) return 0;
		int i = 0;
		while ( ( i < domainName->Length ) && ( i < other->domainName->Length ) )
		{
			if (System::Char::ToLower(domainName[i]) < System::Char::ToLower(other->domainName[i]) ) 
				return -1;
			else if (System::Char::ToLower(domainName[i]) > System::Char::ToLower(other->domainName[i]) ) 
				return 1;
			i++;
		}
		if ( domainName->Length > other->domainName->Length ) 
			return 1;
		return -1;
	}

};
website.cpp:

Code:
#include "StdAfx.h"
#include "website.h"
#include "NoBaseDirectory.h"
#include "NeedSubDirectories.h"

	using namespace System;
	using namespace System::ComponentModel;
	using namespace System::Collections;
	using namespace System::Windows::Forms;
	using namespace System::Data;
	using namespace System::Drawing;

	using namespace System::IO;

	using namespace Sites;


website::website(void)
{
}
website::website(String ^name, String ^path)
{
	domainName  = name;
	localPath   = path;
	pathCount   = 0;
	clientFlag  = 0;
	archiveFlag = 0;
	serverFlag  = 0;
	webFlag     = 0;

}
bool website::operator < (website^ param) {
	int i = 0;
	while ( ( i < domainName->Length ) && ( i < param->domainName->Length ) )
	{
		if (System::Char::ToLower(domainName[i]) < System::Char::ToLower(param->domainName[i]) ) 
			return true;
		else if (System::Char::ToLower(domainName[i]) > System::Char::ToLower(param->domainName[i]) ) 
			return false;
		i++;
	}
	if ( domainName->Length < param->domainName->Length ) 
		return true;
	return false;
}

bool website::CheckDirectory()
{
	for(;;)
	{
		if ( Directory::Exists( localPath ) )
		{
			DirectoryInfo ^ myDir = gcnew DirectoryInfo(localPath);
			array<DirectoryInfo^>^ files = myDir->GetDirectories("*.*");
			for ( int idx = 0 ; idx < files->Length ; idx ++ )
			{
				String ^ subDir = files[idx]->Name;
				if (subDir->ToLower() == "client")
					clientFlag = 1;
				if (subDir->ToLower() == "client.arc")
					archiveFlag = 1;
				if (subDir->ToLower() == "web")
					webFlag = 1;
				if (subDir->ToLower() == "server")
					serverFlag = 1;
				int k = 1;
			}
			pathCount = clientFlag + archiveFlag + webFlag + serverFlag + 1;
			if ( pathCount != 5)
			{
				NeedSubDirectories ^ getSubs = gcnew NeedSubDirectories ( domainName , localPath , this );
				getSubs->ShowDialog();
			}
			return true;
		}
		else
		{
			pathCount = 0;
			NoBaseDirectory ^ noDir = gcnew NoBaseDirectory( domainName , localPath );
			noDir->ShowDialog();
			if (noDir->pathChanged->Equals(true))
			{
				localPath = noDir->newLocalPath;
				continue;
			}

			return false;
		}
	}
}
The main form calls the CheckDirectory method to insure the path and subdirectories exist. If any of the sub-directories is missing it pops up a form to ask if the user wants to create the missing directories.

NeedSubDirectories.h

Code:
#pragma once

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::IO;
using namespace System::Drawing;

#include "website.h"

namespace Sites {

	/// <summary>
	/// Summary for NeedSubDirectories
	///
	/// WARNING: If you change the name of this class, you will need to change the
	///          'Resource File Name' property for the managed resource compiler tool
	///          associated with all .resx files this class depends on.  Otherwise,
	///          the designers will not be able to interact properly with localized
	///          resources associated with this form.
	/// </summary>
	public ref class NeedSubDirectories : public System::Windows::Forms::Form
	{
	private: website ^ WebSite;
	public:
		NeedSubDirectories ( String ^ site , String ^ path , website ^ newSite)
		{
			InitializeComponent();
			WebSite = newSite;
			this->WebName->Text = site;
			this->LocalPath->Text = path;
			if ( newSite->clientFlag == 0 )
			{
				ClientOK->Text = "Missing";
				ClientOK->ForeColor = System::Drawing::Color::Firebrick;
			}
			else
			{
				ClientOK->Text = "OK";
				ClientOK->ForeColor = System::Drawing::Color::Green;
			}
			if ( newSite->archiveFlag == 0 )
			{
				ArchiveOK->Text = "Missing";
				ArchiveOK->ForeColor = System::Drawing::Color::Firebrick;
			}
			else
			{
				ArchiveOK->Text = "OK";
				ArchiveOK->ForeColor = System::Drawing::Color::Green;
			}
			if ( newSite->serverFlag == 0 )
			{
				ServerOK->Text = "Missing";
				ServerOK->ForeColor = System::Drawing::Color::Firebrick;
			}
			else
			{
				ServerOK->Text = "OK";
				ServerOK->ForeColor = System::Drawing::Color::Green;
			}
			if ( newSite->webFlag == 0 )
			{
				WebOK->Text = "Missing";
				WebOK->ForeColor = System::Drawing::Color::Firebrick;
			}
			else
			{
				WebOK->Text = "OK";
				WebOK->ForeColor = System::Drawing::Color::Green;
			}

			//
			//TODO: Add the constructor code here
			//
		}

	protected:
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		~NeedSubDirectories()
		{
			if (components)
			{
				delete components;
			}
		}
	private: System::Windows::Forms::Label^  WebName;
	private: System::Windows::Forms::Label^  LocalPath;
	private: System::Windows::Forms::Label^  label1;
	private: System::Windows::Forms::Label^  label2;
	private: System::Windows::Forms::Label^  label3;
	private: System::Windows::Forms::Label^  label4;
	private: System::Windows::Forms::Label^  label5;
	private: System::Windows::Forms::Label^  ClientOK;
	private: System::Windows::Forms::Label^  WebOK;
	private: System::Windows::Forms::Label^  ServerOK;
	private: System::Windows::Forms::Label^  ArchiveOK;
	private: System::Windows::Forms::Label^  label10;
	private: System::Windows::Forms::Label^  label11;
	private: System::Windows::Forms::Label^  label12;
	private: System::Windows::Forms::Label^  label13;
	private: System::Windows::Forms::Button^  button1;
	private: System::Windows::Forms::Button^  button2;
	protected: 


	private:
		/// <summary>
		/// Required designer variable.
		/// </summary>
		System::ComponentModel::Container ^components;

#pragma region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		void InitializeComponent(void)
		{
			this->WebName = (gcnew System::Windows::Forms::Label());
			this->LocalPath = (gcnew System::Windows::Forms::Label());
			this->label1 = (gcnew System::Windows::Forms::Label());
			this->label2 = (gcnew System::Windows::Forms::Label());
			this->label3 = (gcnew System::Windows::Forms::Label());
			this->label4 = (gcnew System::Windows::Forms::Label());
			this->label5 = (gcnew System::Windows::Forms::Label());
			this->ClientOK = (gcnew System::Windows::Forms::Label());
			this->WebOK = (gcnew System::Windows::Forms::Label());
			this->ServerOK = (gcnew System::Windows::Forms::Label());
			this->ArchiveOK = (gcnew System::Windows::Forms::Label());
			this->label10 = (gcnew System::Windows::Forms::Label());
			this->label11 = (gcnew System::Windows::Forms::Label());
			this->label12 = (gcnew System::Windows::Forms::Label());
			this->label13 = (gcnew System::Windows::Forms::Label());
			this->button1 = (gcnew System::Windows::Forms::Button());
			this->button2 = (gcnew System::Windows::Forms::Button());
			this->SuspendLayout();
			// 
			// Component initialization removed to stay in 20000 char limit
			// 
			this->ResumeLayout(false);
			this->PerformLayout();

		}
#pragma endregion
	private: System::Void NeedSubDirectories_Load(System::Object^  sender, System::EventArgs^  e) {
			 }
private: System::Void button2_Click(System::Object^  sender, System::EventArgs^  e) {
			 this->Close();
		 }
private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
			 // Create the missing directories
			 if (WebSite->clientFlag == 0)
			 {
				 String ^ newDir = gcnew String(WebSite->localPath + "\\Client");
				 if ( System::IO::Directory::CreateDirectory(newDir) )
					WebSite->clientFlag = 1;
			 }
			 if (WebSite->archiveFlag == 0)
			 {
				 String ^ newDir = gcnew String(WebSite->localPath + "\\Client.arc");
				 if ( System::IO::Directory::CreateDirectory(newDir) )
					 WebSite->archiveFlag = 1;
			 }
			 if (WebSite->serverFlag == 0)
			 {
				 String ^ newDir = gcnew String(WebSite->localPath + "\\Server");
				 if ( System::IO::Directory::CreateDirectory(newDir) )
					 WebSite->serverFlag = 1;
			 }
			 if (WebSite->webFlag == 0)
			 {
				 String ^ newDir = gcnew String(WebSite->localPath + "\\Web");
				 if ( System::IO::Directory::CreateDirectory(newDir) )
					 WebSite->webFlag = 1;
			 }
			 this->Close();
			 WebSite->pathCount =  WebSite->clientFlag + WebSite->archiveFlag +
								   WebSite->serverFlag + WebSite->webFlag + 1 ;
		 }
};
}
I need to remember the reference to the website in the sub-form so the process can create the proper directories if the user requests them, but I keep getting warnings/error messages when I move the WebSite member variable around. The previous code has only warnings, and runs, but I’d like to find out the proper syntax so I can eliminate the warnings.

Code:
Compiling...
website.cpp
NeedSubDirectories.h(26) : warning C4677: 'WebSite': signature of non-private member contains assembly private type 'website'
            website.h(4) : see declaration of 'website'
NeedSubDirectories.h(28) : warning C4677: 'NeedSubDirectories': signature of non-private member contains assembly private type 'website'
            website.h(4) : see declaration of 'website'
NeedSubDirectories.cpp
NeedSubDirectories.h(26) : warning C4677: 'WebSite': signature of non-private member contains assembly private type 'website'
            website.h(4) : see declaration of 'website'
NeedSubDirectories.h(28) : warning C4677: 'NeedSubDirectories': signature of non-private member contains assembly private type 'website'
            website.h(4) : see declaration of 'website'
Generating Code...
Linking...
Sites - 0 error(s), 4 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========