C1075 Error

I'm trying to compile a CHUMP program and keep getting this error message

1>CHUMP_Quality_Control_Program.cpp(22): fatal error C1075: end of file found before the left brace '{' at 'c:\users\ialex\documents\visual studio 2010\projects\chump_quality_control_program\chump_quality_control_program\Form1.h(4)' was matched

I read other forums talking about this error and I can't seem to put my finger on what I'm doing wrong. I click on the error link and all it does is it brings me to the .cpp file. It does not direct me to an area in visual studio on where the issue may be. I look at the brackets and compare them to other programs and everything seems fine.

#pragma once

namespace CHUMP_Quality_Control_Program {

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>
/// Summary for Form1
/// </summary>
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}

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

protected:

protected:
private: System::Windows::Forms::TextBox^ txtItems;
private: System::Windows::Forms::TextBox^ txtLog;
private: System::Windows::Forms::Label^ label1;
private: System::Windows::Forms::Label^ label2;

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->btnCreate = (gcnew System::Windows::Forms::Button());
this->txtItems = (gcnew System::Windows::Forms::TextBox());
this->txtLog = (gcnew System::Windows::Forms::TextBox());
this->label1 = (gcnew System::Windows::Forms::Label());
this->label2 = (gcnew System::Windows::Forms::Label());
this->SuspendLayout();
//
// btnCreate
//
this->btnCreate->Location = System::Drawing::Point(317, 44);
this->btnCreate->Name = L"btnCreate";
this->btnCreate->Size = System::Drawing::Size(112, 30);
this->btnCreate->TabIndex = 0;
this->btnCreate->Text = L"Create Log";
this->btnCreate->UseVisualStyleBackColor = true;
this->btnCreate->Click += gcnew System::EventHandler(this, &Form1::btnCreate_Click);
//
// txtItems
//
this->txtItems->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 14.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(0)));
this->txtItems->Location = System::Drawing::Point(60, 50);
this->txtItems->Name = L"txtItems";
this->txtItems->Size = System::Drawing::Size(110, 29);
this->txtItems->TabIndex = 1;
this->txtItems->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
//
// txtLog
//
this->txtLog->Location = System::Drawing::Point(60, 100);
this->txtLog->Multiline = true;
this->txtLog->Name = L"txtLog";
this->txtLog->ScrollBars = System::Windows::Forms::ScrollBars::Vertical;
this->txtLog->Size = System::Drawing::Size(358, 450);
this->txtLog->TabIndex = 2;
//
// label1
//
this->label1->AutoSize = true;
this->label1->Location = System::Drawing::Point(57, 34);
this->label1->Name = L"label1";
this->label1->Size = System::Drawing::Size(80, 13);
this->label1->TabIndex = 3;
this->label1->Text = L"Items produced";
//
// label2
//
this->label2->AutoSize = true;
this->label2->Location = System::Drawing::Point(200, 84);
this->label2->Name = L"label2";
this->label2->Size = System::Drawing::Size(75, 13);
this->label2->TabIndex = 4;
this->label2->Text = L"Production log";
//
// Form1
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(484, 562);
this->Controls->Add(this->label2);
this->Controls->Add(this->label1);
this->Controls->Add(this->txtLog);
this->Controls->Add(this->txtItems);
this->Controls->Add(this->btnCreate);
this->Name = L"Form1";
this->Text = L"CHUMP Quality Control Program";
this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
this->ResumeLayout(false);
this->PerformLayout();

}
#pragma endregion
//Instance variables
Random^ randomNumGen;
String^ strLog;

private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {
DateTime now = DateTime::Now; // Used as seed value
randomNumGen = gcnew Random(now.Millisecond);
strLog = gcnew String("Item\t\tThickness\r\n");
txtItems->Text = "100";
}
private: System::Void btnCreate_Click(System::Object^ sender, System::EventArgs^ e) {
int items;
double thick;

Int32::TryParse(txtItems->Text, items);
for (int i = 0; i<items; i++)
{
thick = randomNumGen->Next(0,1000) /100.0;
strLog += "CHUMP " + i + ":\t" + thick + " mm\r\n";
}
txtLog->Text = strLog;
};
}
YOu have 9 opening brackets and 8 closing. Figure the rest.
Topic archived. No new replies allowed.