[solved] VS2010 problem beim auslagern von Methoden in cpp Datei
-
Hallo,
ich versuche gerade eine garphische Anwendung mit Visual Studio 2010 in C++ zu erstellen.
VS schafft es leider den generierten Code komplett in die Headder Dateien der Form zu schreiben. Nun möchte ich die Methoden in der zugehörige CPP Datei auslagern.
Leider erhalte ich schon beim auslagern des Konstruktors die folgende Fehlermeldung:
Error 1 error C2653: 'frmPersonManager' : is not a class or namespace name
frmPersonManager.h
#pragma once #include"frmPersonManagerAddPerson.h" #include"clspersonmanager.h" namespace CapitalManager { 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 frmPersonManager /// </summary> public ref class frmPersonManager : public System::Windows::Forms::Form { public: //constructors frmPersonManager(void); frmPersonManager(clsPersonManager *personManager); //methodes //variables protected: /// <summary> /// Clean up any resources being used. /// </summary> ~frmPersonManager() { if (components) { delete components; } } private: //variables clsPersonManager *pManager; private: System::Windows::Forms::Button^ bAddPerson; private: System::Windows::Forms::Button^ bDeletePerson; private: System::Windows::Forms::Button^ bEditPerson; private: System::Windows::Forms::DataGridView^ dgvPersons; private: System::Windows::Forms::Label^ label1; private: System::Windows::Forms::Button^ bClose; 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) { System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(frmPersonManager::typeid)); this->bAddPerson = (gcnew System::Windows::Forms::Button()); this->bDeletePerson = (gcnew System::Windows::Forms::Button()); this->bEditPerson = (gcnew System::Windows::Forms::Button()); this->dgvPersons = (gcnew System::Windows::Forms::DataGridView()); this->label1 = (gcnew System::Windows::Forms::Label()); this->bClose = (gcnew System::Windows::Forms::Button()); (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->dgvPersons))->BeginInit(); this->SuspendLayout(); // // bAddPerson // this->bAddPerson->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"bAddPerson.Image"))); this->bAddPerson->Location = System::Drawing::Point(12, 67); this->bAddPerson->Name = L"bAddPerson"; this->bAddPerson->Size = System::Drawing::Size(48, 46); this->bAddPerson->TabIndex = 0; this->bAddPerson->UseVisualStyleBackColor = true; // // bDeletePerson // this->bDeletePerson->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"bDeletePerson.Image"))); this->bDeletePerson->Location = System::Drawing::Point(12, 119); this->bDeletePerson->Name = L"bDeletePerson"; this->bDeletePerson->Size = System::Drawing::Size(48, 46); this->bDeletePerson->TabIndex = 1; this->bDeletePerson->UseVisualStyleBackColor = true; // // bEditPerson // this->bEditPerson->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"bEditPerson.Image"))); this->bEditPerson->Location = System::Drawing::Point(12, 171); this->bEditPerson->Name = L"bEditPerson"; this->bEditPerson->Size = System::Drawing::Size(48, 46); this->bEditPerson->TabIndex = 2; this->bEditPerson->UseVisualStyleBackColor = true; // // dgvPersons // this->dgvPersons->ColumnHeadersHeightSizeMode = System::Windows::Forms::DataGridViewColumnHeadersHeightSizeMode::AutoSize; this->dgvPersons->Location = System::Drawing::Point(75, 67); this->dgvPersons->Name = L"dgvPersons"; this->dgvPersons->Size = System::Drawing::Size(357, 150); this->dgvPersons->TabIndex = 3; // // label1 // this->label1->AutoSize = true; this->label1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 15.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(0))); this->label1->Location = System::Drawing::Point(102, 9); this->label1->Name = L"label1"; this->label1->Size = System::Drawing::Size(236, 25); this->label1->TabIndex = 4; this->label1->Text = L"Personen Verwaltung"; // // bClose // this->bClose->Location = System::Drawing::Point(357, 240); this->bClose->Name = L"bClose"; this->bClose->Size = System::Drawing::Size(75, 23); this->bClose->TabIndex = 5; this->bClose->Text = L"Schließen"; this->bClose->UseVisualStyleBackColor = true; // // frmPersonManager // this->AutoScaleDimensions = System::Drawing::SizeF(6, 13); this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; this->ClientSize = System::Drawing::Size(444, 276); this->Controls->Add(this->bClose); this->Controls->Add(this->label1); this->Controls->Add(this->dgvPersons); this->Controls->Add(this->bEditPerson); this->Controls->Add(this->bDeletePerson); this->Controls->Add(this->bAddPerson); this->Name = L"frmPersonManager"; this->Text = L"frmPersonManager"; (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->dgvPersons))->EndInit(); this->ResumeLayout(false); this->PerformLayout(); } #pragma endregion }; }
frmPersonManager.cpp
#include "frmPersonManager.h" //constructor frmPersonManager::frmPersonManager(void) { InitializeComponent(); }
Ich hoffe dies ist das richtige Forum und bedanke mich schonmal für eure Hilfe.
Christoph
-
Es scheint so, als hätte ein
using namespace CapitalManager;
in der cpp Datei gefehlt. Es funktioniert jetzt aufjedenfall.