My form is declared but its not compiling.

Hi

Ive been haveing problems with opening new forms.
The problem is I have been using the same code to open for for a while now and
it has only recently started to come up these errors.

c:\users\hamish\documents\visual studio 2010\projects\sose quiz\sose quiz\Incorrect.h(101): error C2065: 'Q1' : undeclared identifier
1>c:\users\hamish\documents\visual studio 2010\projects\sose quiz\sose quiz\Incorrect.h(101): error C2065: 'fQ1' : undeclared identifier
1>c:\users\hamish\documents\visual studio 2010\projects\sose quiz\sose quiz\Incorrect.h(101): error C2061: syntax error : identifier 'Q1'
1>c:\users\hamish\documents\visual studio 2010\projects\sose quiz\sose quiz\Incorrect.h(102): error C2065: 'fQ1' : undeclared identifier
1>c:\users\hamish\documents\visual studio 2010\projects\sose quiz\sose quiz\Incorrect.h(102): error C2227: left of '->ShowDialog' must point to class/struct/union/generic type

It seems to be that the form that i am in cant see the other forms even though I've included them.

I am using Visual Studio 2010 Ultimate by the way.

Thanks
Hamish
Last edited on
Also here's my code:
#pragma once
#include "Q1.h"

namespace SOSEQuiz {

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace std;

/// <summary>
/// Summary for Incorrect
/// </summary>
public ref class Incorrect : public System::Windows::Forms::Form
{
public:
Incorrect(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}

protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~Incorrect()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::Button^ button1;
protected:
private: System::Windows::Forms::Label^ label1;

private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Container ^components;

#pragma region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
this->button1 = (gcnew System::Windows::Forms::Button());
this->label1 = (gcnew System::Windows::Forms::Label());
this->SuspendLayout();
//
// button1
//
this->button1->Location = System::Drawing::Point(18, 26);
this->button1->Name = L"button1";
this->button1->Size = System::Drawing::Size(75, 23);
this->button1->TabIndex = 0;
this->button1->Text = L"Start Over";
this->button1->UseVisualStyleBackColor = true;
this->button1->Click += gcnew System::EventHandler(this, &Incorrect::button1_Click);
//
// label1
//
this->label1->AutoSize = true;
this->label1->Location = System::Drawing::Point(12, 9);
this->label1->Name = L"label1";
this->label1->Size = System::Drawing::Size(91, 13);
this->label1->TabIndex = 1;
this->label1->Text = L"Please try again :)";
//
// Incorrect
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(116, 61);
this->ControlBox = false;
this->Controls->Add(this->label1);
this->Controls->Add(this->button1);
this->MaximizeBox = false;
this->MinimizeBox = false;
this->Name = L"Incorrect";
this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;
this->Text = L"You are Incorrect :(";
this->Load += gcnew System::EventHandler(this, &Incorrect::Incorrect_Load);
this->ResumeLayout(false);
this->PerformLayout();

}
#pragma endregion
private: System::Void Incorrect_Load(System::Object^ sender, System::EventArgs^ e) {
}
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
Q1^ fQ1 = gcnew Q1();
fQ1->ShowDialog();
}
};
}
Topic archived. No new replies allowed.