Hello. I'm very new at C++ world, so, I need some help.
I'm building an Browser Called iNet, and, it gave me 4 errors:
c:\users\sepultura\documents\visual studio 2008\projects\inet 0.1\inet 0.1\iNet.h(193) : error C2039: 'timer1_Tick' : is not a member of 'iNet01::iNet'
c:\users\sepultura\documents\visual studio 2008\projects\inet 0.1\inet 0.1\iNet.h(22) : see declaration of 'iNet01::iNet'
c:\users\sepultura\documents\visual studio 2008\projects\inet 0.1\inet 0.1\iNet.h(193) : error C2065: 'timer1_Tick' : undeclared identifier
c:\users\sepultura\documents\visual studio 2008\projects\inet 0.1\inet 0.1\iNet.h(193) : error C3350: 'System::EventHandler' : a delegate constructor expects 2 argument(s)
here is my code:
#pragma once
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
namespace iNet01 {
/// <summary>
/// Summary for iNet
///
/// 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 iNet : public System::Windows::Forms::Form
{
public:
iNet(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~iNet()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::WebBrowser^ webBrowser1;
protected:
private: System::Windows::Forms::Button^ button1;
private: System::Windows::Forms::Button^ button2;
private: System::Windows::Forms::TextBox^ textBox1;
private: System::Windows::Forms::Button^ button3;
private: System::Windows::Forms::Button^ button4;
private: System::Windows::Forms::Button^ button5;
private: System::Windows::Forms::Button^ button6;
private: System::Windows::Forms::ProgressBar^ progressBar1;
private: System::Windows::Forms::Timer^ timer1;
private: System::ComponentModel::IContainer^ components;
private:
/// <summary>
/// Required designer variable.
/// </summary>
#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->components = (gcnew System::ComponentModel::Container());
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(iNet::typeid));
this->webBrowser1 = (gcnew System::Windows::Forms::WebBrowser());
this->button1 = (gcnew System::Windows::Forms::Button());
this->button2 = (gcnew System::Windows::Forms::Button());
this->textBox1 = (gcnew System::Windows::Forms::TextBox());
this->button3 = (gcnew System::Windows::Forms::Button());
this->button4 = (gcnew System::Windows::Forms::Button());
this->button5 = (gcnew System::Windows::Forms::Button());
this->button6 = (gcnew System::Windows::Forms::Button());
this->progressBar1 = (gcnew System::Windows::Forms::ProgressBar());
this->timer1 = (gcnew System::Windows::Forms::Timer(this->components));
this->SuspendLayout();
//
// webBrowser1
//
this->webBrowser1->Location = System::Drawing::Point(1, 84);
this->webBrowser1->MinimumSize = System::Drawing::Size(20, 20);
this->webBrowser1->Name = L"webBrowser1";
this->webBrowser1->ScriptErrorsSuppressed = true;
this->webBrowser1->Size = System::Drawing::Size(1369, 692);
this->webBrowser1->TabIndex = 0;
//
// button1
//
this->button1->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"button1.Image")));
this->button1->Location = System::Drawing::Point(12, 41);
this->button1->Name = L"button1";
this->button1->Size = System::Drawing::Size(37, 37);
this->button1->TabIndex = 1;
this->button1->UseVisualStyleBackColor = true;
this->button1->Click += gcnew System::EventHandler(this, &iNet::button1_Click);
//
// button2
//
this->button2->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"button2.Image")));
this->button2->Location = System::Drawing::Point(55, 41);
this->button2->Name = L"button2";
this->button2->Size = System::Drawing::Size(37, 37);
this->button2->TabIndex = 2;
this->button2->UseVisualStyleBackColor = true;
this->button2->Click += gcnew System::EventHandler(this, &iNet::button2_Click);
//
// textBox1
//
this->textBox1->Location = System::Drawing::Point(98, 41);
this->textBox1->Multiline = true;
this->textBox1->Name = L"textBox1";
this->textBox1->Size = System::Drawing::Size(1068, 37);
this->textBox1->TabIndex = 3;
//
// button3
//
this->button3->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"button3.Image")));
this->button3->Location = System::Drawing::Point(1316, 41);
this->button3->Name = L"button3";
this->button3->Size = System::Drawing::Size(42, 37);
this->button3->TabIndex = 5;
this->button3->UseVisualStyleBackColor = true;
this->button3->Click += gcnew System::EventHandler(this, &iNet::button3_Click);
//
// button4
//
this->button4->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"button4.Image")));
this->button4->Location = System::Drawing::Point(1172, 41);
this->button4->Name = L"button4";
this->button4->Size = System::Drawing::Size(42, 37);
this->button4->TabIndex = 8;
this->button4->UseVisualStyleBackColor = true;
this->button4->Click += gcnew System::EventHandler(this, &iNet::button4_Click);
//
// button5
//
this->button5->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"button5.Image")));
this->button5->Location = System::Drawing::Point(1220, 41);
this->button5->Name = L"button5";
this->button5->Size = System::Drawing::Size(42, 37);
this->button5->TabIndex = 9;
this->button5->UseVisualStyleBackColor = true;
this->button5->Click += gcnew System::EventHandler(this, &iNet::button5_Click);
//
// button6
//
this->button6->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"button6.Image")));
this->button6->Location = System::Drawing::Point(1268, 41);
this->button6->Name = L"button6";
this->button6->Size = System::Drawing::Size(42, 37);
this->button6->TabIndex = 10;
this->button6->UseVisualStyleBackColor = true;
this->button6->Click += gcnew System::EventHandler(this, &iNet::button6_Click);
//
// progressBar1
//
this->progressBar1->Location = System::Drawing::Point(12, 782);
this->progressBar1->Name = L"progressBar1";
this->progressBar1->Size = System::Drawing::Size(177, 13);
this->progressBar1->TabIndex = 11;
//
// timer1
//
this->timer1->Enabled = true;
this->timer1->Interval = 500;
this->timer1->Tick += gcnew System::EventHandler(this, &iNet::timer1_Tick);
//
// iNet
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(1370, 797);
this->Controls->Add(this->progressBar1);
this->Controls->Add(this->button6);
this->Controls->Add(this->button5);
this->Controls->Add(this->textBox1);
this->Controls->Add(this->button4);
this->Controls->Add(this->button2);
this->Controls->Add(this->button1);
this->Controls->Add(this->button3);
this->Controls->Add(this->webBrowser1);
this->MaximumSize = System::Drawing::Size(1920, 1080);
this->MinimumSize = System::Drawing::Size(16, 38);
this->Name = L"iNet";
this->Text = L"iNet";
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
public: int inet01;
private: System::Void contextMenuStrip1_Opening(System::Object^ sender, System::ComponentModel::CancelEventArgs^ e) {
}
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
this->webBrowser1->GoBack();
}
private: System::Void button4_Click(System::Object^ sender, System::EventArgs^ e) {
this->webBrowser1->Refresh();
}
private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {
this->webBrowser1->GoForward();
}
private: System::Void button3_Click(System::Object^ sender, System::EventArgs^ e) {
this->webBrowser1->Navigate(this->textBox1->Text);
}
private: System::Void button5_Click(System::Object^ sender, System::EventArgs^ e) {
this->webBrowser1->Stop();
}
private: System::Void button6_Click(System::Object^ sender, System::EventArgs^ e) {
this->webBrowser1->Print();
}
};
}