我正在编写具有3个类的GUI软件。
操作 主窗体 Farbmixtable
main()方法处于Operation中,并创建一个新的Operation对象。 创建对象后,应使用操作对象引用启动MainForm对象,但无法正常工作
Operation.h
#ifndef Operation_H
#define Operation_H
#include "MainForm.h"
#include "Farbmixtable.h"
#include <string>
#include <array>
class Operation
{
public:
Operation();
void showFarbmix();
int output();
int comport();
private:
};
#endif
Operation.cpp
int Farbmixtabelle_Value[32][16];
Operation::Operation()
{
for (int i = 0; i < 32; i++) {
for (int x = 0; x < 16; x++) {
if (x < 16) {
if (i == x && i <= 16) {
Farbmixtabelle_Value[i][x] = 20;
}
else {
Farbmixtabelle_Value[i][x] = 0;
}
}
else {
}
}
}
}
//...
void main(array<String^>^ arg) {
Operation oper;
//CISGUI::Farbmixtabelle ^ Farbmix = gcnew CISGUI::Farbmixtabelle;
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
CISGUI::MainForm form(&oper); //"CISGUI"::MainForm: The class has no copy constructore
Application::Run(%form);
}
MainForm.h
public ref class MainForm : public System::Windows::Forms::Form
{
public:
MainForm(Operation& op) // Syntaxerror: identifier "Operation"
//:oper(op)
{
InitializeComponent();
if (op.output() == 20) { // "op" undeclared identifier
this->label_middle_left_header->Text = "Yes";
}
else {
this->label_middle_left_header->Text = "No";
}
}
// ...
我如何获得MainForm和Farbmixtable的Operation引用?