Habe noch eine Frage:
Wenn ich eine Formanwendung starte habe ich automatisch die Datei Form1.h wo die Einstellungen gespeichert sind und da schreibe ich dann die Load Events alle rein doch ich bekomme immer Fehlermeldungen:
Was hat es mit den Klassen aufsich?
Wenn ich eine Formanwendung starte habe ich automatisch die Datei Form1.h wo die Einstellungen gespeichert sind und da schreibe ich dann die Load Events alle rein doch ich bekomme immer Fehlermeldungen:
PHP Code:
#pragma once
namespace Notizblock {
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>
/// Zusammenfassung für Form1
/// </summary>
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
//
//TODO: Konstruktorcode hier hinzufügen.
//
}
protected:
/// <summary>
/// Verwendete Ressourcen bereinigen.
/// </summary>
~Form1()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::TextBox^ textBox1;
private: System::Windows::Forms::MenuStrip^ menuStrip1;
private: System::Windows::Forms::ToolStripMenuItem^ dateiToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ beendenToolStripMenuItem;
protected:
private:
/// <summary>
/// Erforderliche Designervariable.
/// </summary>
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
/// <summary>
/// Erforderliche Methode für die Designerunterstützung.
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
/// </summary>
void InitializeComponent(void)
{
this->textBox1 = (gcnew System::Windows::Forms::TextBox());
this->menuStrip1 = (gcnew System::Windows::Forms::MenuStrip());
this->dateiToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->beendenToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->menuStrip1->SuspendLayout();
this->SuspendLayout();
//
// textBox1
//
this->textBox1->BackColor = System::Drawing::Color::Cornsilk;
this->textBox1->Font = (gcnew System::Drawing::Font(L"Segoe Print", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(0)));
this->textBox1->Location = System::Drawing::Point(0, 27);
this->textBox1->Multiline = true;
this->textBox1->Name = L"textBox1";
this->textBox1->Size = System::Drawing::Size(311, 400);
this->textBox1->TabIndex = 0;
//
// menuStrip1
//
this->menuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(1) {this->dateiToolStripMenuItem});
this->menuStrip1->Location = System::Drawing::Point(0, 0);
this->menuStrip1->Name = L"menuStrip1";
this->menuStrip1->Size = System::Drawing::Size(311, 24);
this->menuStrip1->TabIndex = 1;
this->menuStrip1->Text = L"menuStrip1";
//
// dateiToolStripMenuItem
//
this->dateiToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(1) {this->beendenToolStripMenuItem});
this->dateiToolStripMenuItem->Name = L"dateiToolStripMenuItem";
this->dateiToolStripMenuItem->Size = System::Drawing::Size(46, 20);
this->dateiToolStripMenuItem->Text = L"Datei";
//
// beendenToolStripMenuItem
//
this->beendenToolStripMenuItem->Name = L"beendenToolStripMenuItem";
this->beendenToolStripMenuItem->Size = System::Drawing::Size(120, 22);
this->beendenToolStripMenuItem->Text = L"Beenden";
this->beendenToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::beendenToolStripMenuItem_Click);
//
// Form1
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(311, 427);
this->Controls->Add(this->textBox1);
this->Controls->Add(this->menuStrip1);
this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::SizableToolWindow;
this->MainMenuStrip = this->menuStrip1;
this->Name = L"Form1";
this->ShowIcon = false;
this->Text = L"Notizblock - by SS";
this->FormClosing += gcnew System::Windows::Forms::FormClosingEventHandler(this, &Form1::Form1_FormClosing);
this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
this->menuStrip1->ResumeLayout(false);
this->menuStrip1->PerformLayout();
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
private: System::Void beendenToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e)
{
Close();
}
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e)
{
//LADEN
}
private: System::Void Form1_FormClosing(System::Object^ sender, System::Windows::Forms::FormClosingEventArgs^ e)
{
//SPEICHERN
System.IO.StreamWriter sw = new System.IO.StreamWriter("notes.txt");
sw.WriteLine(textBox1.Text);
sw.Flush();
}
};
}
PHP Code:
Fehler 1 error C2882: 'System': Unzulässige Verwendung eines Namespace-Bezeichners in einem Ausdruck c:\users\strasser stefan\desktop\c++ projekte\notizblock\notizblock\Form1.h 129
Fehler 10 error C2228: Links von ".Flush" muss sich eine Klasse/Struktur/Union befinden. c:\users\strasser stefan\desktop\c++ projekte\notizblock\notizblock\Form1.h 131
Fehler 7 error C2227: Links von "->WriteLine" muss sich ein Zeiger auf Klassen-/Struktur-/Union-/generischen Typ befinden. c:\users\strasser stefan\desktop\c++ projekte\notizblock\notizblock\Form1.h 130
Fehler 4 error C2227: Links von "->sw" muss sich ein Zeiger auf Klassen-/Struktur-/Union-/generischen Typ befinden. c:\users\strasser stefan\desktop\c++ projekte\notizblock\notizblock\Form1.h 129
Fehler 3 error C2227: Links von "->StreamWriter" muss sich ein Zeiger auf Klassen-/Struktur-/Union-/generischen Typ befinden. c:\users\strasser stefan\desktop\c++ projekte\notizblock\notizblock\Form1.h 129
Fehler 2 error C2227: Links von "->IO" muss sich ein Zeiger auf Klassen-/Struktur-/Union-/generischen Typ befinden. c:\users\strasser stefan\desktop\c++ projekte\notizblock\notizblock\Form1.h 129
Fehler 5 error C2059: Syntaxfehler: 'this' c:\users\strasser stefan\desktop\c++ projekte\notizblock\notizblock\Form1.h 129
Fehler 8 error C2059: Syntaxfehler: '(' c:\users\strasser stefan\desktop\c++ projekte\notizblock\notizblock\Form1.h 130
Fehler 6 error C2039: 'sw': Ist kein Element von 'Notizblock::Form1' c:\users\strasser stefan\desktop\c++ projekte\notizblock\notizblock\Form1.h 130
Fehler 9 error C2039: 'sw': Ist kein Element von 'Notizblock::Form1' c:\users\strasser stefan\desktop\c++ projekte\notizblock\notizblock\Form1.h 131
Comment