-1
我正在使用全局类来设置其中的一些信息。我想填写这个班级的名单。将文本添加到全局类中的静态列表中
我想这一点:
#pragma once
#include "Element.h"
#include "PLCconnection.h"
ref class ManagedGlobals {
public:
static List<Element^>^ G_elementList; //wordt gedefineerd in ReadPlotFile.cpp
static System::String^ G_plotFileName; //wordt gedefineerd in PlotFileForm.h
static System::String^ G_Language; //wordt gedefineerd in MainForm.h
static PLCconnection^ G_PLCverbinding = gcnew PLCconnection();
static bool G_plcOnline = G_PLCverbinding->ConnectToPLC();
static List<System::String^>^ G_VariableList = gcnew List<System::String^>;
//static List<System::String^>^ G_VariableList = gcnew List <System::String^>;
G_VariableList = G_PLCverbinding->LeesTest2(); // this line gives the error
};
错误,我得到:this declaration has no storage class or type specifier
我该如何解决这个问题?我在我的项目的多个地方使用这个列表,所以我需要它是全球性的。