Итак, я сделал приложение Windows32 C ++ DLL в Visual Studio 2012, а затем добавил форму Windows в разделе «Файлы заголовка» и дал ему имя «userInterface.h». Когда я нажал кнопку «Добавить», я получил всплывающее окно, сказав: «Вы добавляете компонент CLR в нативный проект. Ваш проект будет преобразован, чтобы иметь общую поддержку времени выполнения языка. Вы хотите продолжить?» И я нажал «да», и он сделал файлы «userInterface1.cpp» и «userInterface1.h». Вот его содержимое: < /p>
#pragma once
namespace AssultCubeDLL {
//ERRORS HERE: ******************************************************
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
///
/// Summary for UserInterface
///
// ERROS HERE: *********************************************************
public ref class UserInterface : public System::Windows::Forms::Form
{
public:
UserInterface(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
protected:
///
/// Clean up any resources being used.
///
~UserInterface()
{
if (components)
{
delete components;
}
}
private:
///
/// Required designer variable.
///
// ERRORS HERE: ************************************************
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
void InitializeComponent(void)
{
this->SuspendLayout();
//
// UserInterface
// ERRORS HERE: *******************************************************
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(284, 262);
this->Name = L"UserInterface";
this->Text = L"UserInterface";
this->Load += gcnew System::EventHandler(this, &UserInterface::UserInterface_Load);
this->ResumeLayout(false);
}
#pragma endregion
private: System::Void UserInterface_Load(System::Object^ sender, System::EventArgs^ e) {
}
};
}
< /code>
Я добавил комментарии в то, где появляются ошибки, как «Ошибка: Имя, за которым следует» :: «Должен быть класс или имя пространства имен». Кто -нибудь знает, почему у меня возникают эти проблемы?
Подробнее здесь: https://stackoverflow.com/questions/140 ... indowsform