Nie wiem czemu ale podczas kompilacji wyskakuje mi błąd
Error 4 error C2065: 'TModification' : undeclared identifier
Error 5 error C2065: 'new_Window' : undeclared identifier
A połączyłem oba formy ze sobą jak pokazano tutaj
http://kurs-c-plus-plus.cba.pl/?page_id=437
Oto kod moich form ( button 3 odpowiada za otwarcie nowego forma Modification )
#pragma once
#include <string>
#include <fstream>
#include "Str.h"
#include <vector>
#include <iostream>
#include <conio.h>
#include "Nawigacja.h"
#include "TModification.h"
#include <stdio.h>
namespace Project2 {
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 TMenu
/// </summary>
public ref class TMenu : public System::Windows::Forms::Form
{
public:
vector<string> *v ;
TMenu(void)
{
InitializeComponent();
v= new vector<string>;
//
//TODO: Add the constructor code here
//
}
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~TMenu()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::Button^ button1;
protected:
private: System::Windows::Forms::Button^ button3;
public:
protected:
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->button3 = (gcnew System::Windows::Forms::Button());
this->SuspendLayout();
//
// button1
//
this->button1->Location = System::Drawing::Point(109, 176);
this->button1->Name = L"button1";
this->button1->Size = System::Drawing::Size(75, 23);
this->button1->TabIndex = 0;
this->button1->Text = L"Zakończ";
this->button1->UseVisualStyleBackColor = true;
this->button1->Click += gcnew System::EventHandler(this, &TMenu::button1_Click_1);
//
// button3
//
this->button3->Location = System::Drawing::Point(109, 43);
this->button3->Name = L"button3";
this->button3->Size = System::Drawing::Size(75, 23);
this->button3->TabIndex = 2;
this->button3->Text = L"Wyszukaj";
this->button3->UseVisualStyleBackColor = true;
this->button3->Click += gcnew System::EventHandler(this, &TMenu::button3_Click);
//
// TMenu
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(284, 261);
this->Controls->Add(this->button3);
this->Controls->Add(this->button1);
this->Name = L"TMenu";
this->Text = L"TMenu";
this->Load += gcnew System::EventHandler(this, &TMenu::TMenu_Load);
this->ResumeLayout(false);
}
#pragma endregion
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
show_data();
}
public: System::Void TMenu_Load(System::Object^ sender, System::EventArgs^ e) {
load_data();
}
private: System::Void button1_Click_1(System::Object^ sender, System::EventArgs^ e) {
Application::Exit();
}
void load_data(){
int numerWiersza = 0;
string wiersz;
ifstream f("przystanki.txt");
if (f.is_open())
{
while (getline (f, wiersz,'\t'))
{
v->push_back(wiersz);
}
}
f.close();
}
void show_data(){
int i = 0 ;
for (i = 0; i<v->size();i++)
MessageBox::Show(gcnew String(v->at(i).c_str()));
}
private: System::Void button3_Click(System::Object^ sender, System::EventArgs^ e) {
TModification^ new_Window = gcnew TModification;
this->Hide();
new_Window->ShowDialog();
this->Show();
}
};
}
a to początek TModification
#pragma once
#include <string>
#include "TMenu.h"
namespace Project2 {