In your GlobalVariables.h file:
Code:
#include "stdafx.h"
#ifndef GLOBALVARIABLES_H
#define GLOBALVARIABLES_H
public ref class GlobalVariables
{
public:
static System::String^ display;
};
#endif
-----------------------------------
Code:
In your stdafx.h file:
#pragma once
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include "GlobalVariables.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;
-----------------------------------------------
To use the global string in your code by referencing like this:
GlobalVariables:: display = GlobalVariables:: display + "a string";
or:
GlobalVariables:: display += "a string";