これは Winform1 です:
#include "Winform2.h"
#include "Winform3.h"
namespace Winform1 {
/// <summary>
/// Summary for Winform1
///
/// 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 Winform1: public System::Windows::Forms::Form
{
public:
private: System::Windows::Forms::Button^ button1;
private: System::Windows::Forms::Button^ button2;
private: System::Windows::Forms::Label^ label1;
private: System::Windows::Forms::Label^ label3;
private: System::Windows::Forms::Button^ button3;
private: System::Windows::Forms::Label^ label2;
private: System::Windows::Forms::Label^ label4;
private: System::Windows::Forms::Button^ button4;
public:
unordered_map<int, std::string>* fb_contas_email;
Usuario* usuario;
WinForm1(Usuario* user,
unordered_map<int, std::string>* fb_contas_)
{
this->fb_contas_email = fb_contas_;
this->usuario = user;
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
this->Visible = false;
this->Close();
WinForm2 wf2(this->usuario);
wf2.ShowDialog();
}
private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {
this->Visible = false;
this->Close();
WinForm3 wf3(this->usuario);
wf3.ShowDialog();
}
//...
これは Winform2 です:
#include "Winform1.h"
namespace Winform2 {
/// <summary>
/// Summary for Winform2
///
/// 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 Winform2: public System::Windows::Forms::Form
{
public:
private: System::Windows::Forms::Button^ button1;
private: System::Windows::Forms::Button^ button2;
private: System::Windows::Forms::Label^ label1;
private: System::Windows::Forms::Label^ label3;
private: System::Windows::Forms::Button^ button3;
private: System::Windows::Forms::Label^ label2;
private: System::Windows::Forms::Label^ label4;
private: System::Windows::Forms::Button^ button4;
public:
unordered_map<int, std::string>* fb_contas_email;
Usuario* usuario;
WinForm2(Usuario* user,
unordered_map<int, std::string>* fb_contas_)
{
this->fb_contas_email = fb_contas_;
this->usuario = user;
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
private: System::Void button4_Click(System::Object^ sender, System::EventArgs^ e) {
this->Visible = false;
this->Close();
WinForm1 wf1(this->usuario);
wf1.ShowDialog();
}
//...
これはWinforms 3です:
namespace Winform3 {
/// <summary>
/// Summary for Winform3
///
/// 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 Winform3: public System::Windows::Forms::Form
{
public:
private: System::Windows::Forms::Button^ button1;
private: System::Windows::Forms::Button^ button2;
private: System::Windows::Forms::Label^ label1;
private: System::Windows::Forms::Label^ label3;
private: System::Windows::Forms::Button^ button3;
private: System::Windows::Forms::Label^ label2;
private: System::Windows::Forms::Label^ label4;
private: System::Windows::Forms::Button^ button4;
public:
unordered_map<int, std::string>* fb_contas_email;
Usuario* usuario;
WinForm3(Usuario* user,
unordered_map<int, std::string>* fb_contas_)
{
this->fb_contas_email = fb_contas_;
this->usuario = user;
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
//...
このエラーを解決するにはどうすればよいですか? Winform1 から Winform2 へ、またはその逆に行き来する必要があります。しかし、おそらくダイアログを表示するときに未定義のクラスのエラーがスローされます。しかし、そのダイアログを再度呼び出して戻ってくるには、インクルードが必要です。
私は何をすべきか?winform1 と winform2 の間を行き来するためにダイアログを表示する必要があります
前もって感謝します