Есть Код, Нужен Проект

Тема в разделе "C/C++/C#", создана пользователем kisslata, 4 май 2013.

  1. kisslata

    kisslata New Member

    Регистрация:
    15 ноя 2012
    Сообщения:
    2
    Симпатии:
    0
    Ребята, помогите. В чем суть. Есть листинг рабочей программы, но мне нужно сделать проект и каждый файл отдельно. При простом копировании и создании файлов вылазит ошибка и ничего не компилится. Помогите, пожалуйста.
    <div class="sp-wrap"><div class="sp-head-wrap"><div class="sp-head folded clickable">"Листинг программы"</div></div><div class="sp-body"><div class="sp-content">
    Код (C++):
    MainFrm.cpp


    #include <vcl.h>
    #pragma hdrstop
    #include "MainFrm.h"
    #include "DMFrm.h"
    #include "AvtoReg.h"
    #include "DodFrm.h"
    #include "FindFrm.h"
    #include "ProFrm.h"
    //---------------------------------------------------------------------------
    #pragma package(smart_init)
    #pragma resource "*.dfm"
    TMainForm *MainForm;
    //---------------------------------------------------------------------------
    __fastcall TMainForm::TMainForm(TComponent* Owner)
    : TForm(Owner)
    {
    }
    //---------------------------------------------------------------------------
    void __fastcall TMainForm::Button5Click(TObject *Sender)
    {
    Close();     
    }
    //---------------------------------------------------------------------------
    void __fastcall TMainForm::N5Click(TObject *Sender)
    {
    Close();       
    }
    //---------------------------------------------------------------------------
    void __fastcall TMainForm::Button1Click(TObject *Sender)
    {
    MainForm->AvtoR->DodRecord();
    }
    //---------------------------------------------------------------------------
    void __fastcall TMainForm::Button2Click(TObject *Sender)
    {
    MainForm->AvtoR->RedRecord();
    }
    //---------------------------------------------------------------------------
    void __fastcall TMainForm::Button3Click(TObject *Sender)
    {
    MainForm->AvtoR->DelRecord();
    }
    //---------------------------------------------------------------------------
    void __fastcall TMainForm::Button4Click(TObject *Sender)
    {
    FindForm->ShowModal();
    }
    //---------------------------------------------------------------------------
    void __fastcall TMainForm::N6Click(TObject *Sender)
    {
    MainForm->AvtoR->DodRecord();
    }
    //---------------------------------------------------------------------------
    void __fastcall TMainForm::N7Click(TObject *Sender)
    {
    MainForm->AvtoR->RedRecord();
    }
    //---------------------------------------------------------------------------
    void __fastcall TMainForm::N10Click(TObject *Sender)
    {
    MainForm->AvtoR->DelRecord();
    }
    //---------------------------------------------------------------------------
    void __fastcall TMainForm::N8Click(TObject *Sender)
    {
    FindForm->ShowModal();     
    }
    //---------------------------------------------------------------------------
    void __fastcall TMainForm::N9Click(TObject *Sender)
    {
    ProForm->ShowModal();
    }




    MainFrm.h


    #ifndef MainFrmH
    #define MainFrmH
    //---------------------------------------------------------------------------
    #include <Classes.hpp>
    #include <Controls.hpp>
    #include <StdCtrls.hpp>
    #include <Forms.hpp>
    #include <DBGrids.hpp>
    #include <Grids.hpp>
    #include <ExtCtrls.hpp>
    #include <Menus.hpp>
    class TAvtoR;
    //---------------------------------------------------------------------------
    class TMainForm : public TForm
    {
    __published:    // IDE-managed Components
    TDBGrid *DBGrid1;
    TMainMenu *MainMenu1;
    TMenuItem *N1;
    TMenuItem *N2;
    TMenuItem *N3;
    TMenuItem *N4;
    TMenuItem *N5;
    TMenuItem *N6;
    TMenuItem *N7;
    TMenuItem *N8;
    TMenuItem *N9;
    TBevel *Bevel1;
    TButton *Button1;
    TButton *Button2;
    TButton *Button3;
    TButton *Button4;
    TButton *Button5;
    TMenuItem *N10;
    void __fastcall Button5Click(TObject *Sender);
    void __fastcall N5Click(TObject *Sender);
    void __fastcall Button1Click(TObject *Sender);
    void __fastcall Button2Click(TObject *Sender);
    void __fastcall Button3Click(TObject *Sender);
    void __fastcall Button4Click(TObject *Sender);
    void __fastcall N6Click(TObject *Sender);
    void __fastcall N7Click(TObject *Sender);
    void __fastcall N10Click(TObject *Sender);
    void __fastcall N8Click(TObject *Sender);
    void __fastcall N9Click(TObject *Sender);
    private:    // User declarations
    public:     // User declarations
    TAvtoR *AvtoR;
    __fastcall TMainForm(TComponent* Owner);
    };
    //---------------------------------------------------------------------------
    extern PACKAGE TMainForm *MainForm;
    //---------------------------------------------------------------------------
    #endif




    FindFrm.cpp


    #include <vcl.h>
    #pragma hdrstop
    #include "FindFrm.h"
    #include "DMFrm.h"
    #include "MainFrm.h"
    #include "AvtoReg.h"
    //---------------------------------------------------------------------------
    #pragma package(smart_init)
    #pragma resource "*.dfm"
    TFindForm *FindForm;
    //---------------------------------------------------------------------------
    __fastcall TFindForm::TFindForm(TComponent* Owner)
    : TForm(Owner)
    {
    }
    //---------------------------------------------------------------------------
    void __fastcall TFindForm::Edit1Change(TObject *Sender)
    {     DM->Query->Close();
    if (FindForm->Edit1->Text.Length()>0)
    MainForm->AvtoR->FindRecord("Дер_Рег_Номер", FindForm->Edit1->Text);
    else
    DM->Query->Close();
    }
    //---------------------------------------------------------------------------
    void __fastcall TFindForm::Edit3Change(TObject *Sender)
    {
    DM->Query->Close();
    if (FindForm->Edit3->Text.Length()>0)
    MainForm->AvtoR->FindRecord("Колір", FindForm->Edit3->Text);
    else
    DM->Query->Close();
    }

    void __fastcall TFindForm::Edit2Change(TObject *Sender)
    {
    DM->Query->Close();
    if (FindForm->Edit2->Text.Length()>0)
    MainForm->AvtoR->FindRecord("Марка", FindForm->Edit2->Text);
    else
    DM->Query->Close();
    }
    //---------------------------------------------------------------------------
    void __fastcall TFindForm::Edit4Change(TObject *Sender)
    {
    DM->Query->Close();
    if (FindForm->Edit4->Text.Length()>0)
    MainForm->AvtoR->FindRecord("Обєм_Двигуна", FindForm->Edit4->Text);
    else
    DM->Query->Close();
    }
    //---------------------------------------------------------------------------
    void __fastcall TFindForm::Edit5Change(TObject *Sender)
    {
    DM->Query->Close();
    if (FindForm->Edit5->Text.Length()>0)
    MainForm->AvtoR->FindRecord("Рік_Випуску", FindForm->Edit5->Text);
    else
    DM->Query->Close();
    }
    //---------------------------------------------------------------------------
    void __fastcall TFindForm::Edit6Change(TObject *Sender)
    {
    DM->Query->Close();
    if (FindForm->Edit6->Text.Length()>0)
    MainForm->AvtoR->FindRecord("Модель", FindForm->Edit6->Text);
    else
    DM->Query->Close();
    }
    //---------------------------------------------------------------------------
    void __fastcall TFindForm::Edit7Change(TObject *Sender)
    {
    DM->Query->Close();
    if (FindForm->Edit7->Text.Length()>0)
    MainForm->AvtoR->FindRecord("Тип_ТЗ", FindForm->Edit7->Text);
    else
    DM->Query->Close();}


    void __fastcall TFindForm::Edit8Change(TObject *Sender)
    {
    DM->Query->Close();
    if (FindForm->Edit8->Text.Length()>0)
    MainForm->AvtoR->FindRecord("Власник", FindForm->Edit8->Text);
    else
    DM->Query->Close();
    }
    //---------------------------------------------------------------------------

    void __fastcall TFindForm::Button2Click(TObject *Sender)
    {
    Close();       
    }
    //---------------------------------------------------------------------------
    void __fastcall TFindForm::Button1Click(TObject *Sender)
    {
    Edit1->Clear();
    Edit2->Clear();
    Edit3->Clear();
    Edit4->Clear();
    Edit5->Clear();
    Edit6->Clear();
    Edit7->Clear();
    Edit8->Clear();
    }




    AvtoReg.h


    #ifndef AvtoRegH
    #define AvtoRegH
    //---------------------------------------------------------------------------
    #include <Classes.hpp>
    //---------------------------------------------------------------------------
    class TAvtoR
    {          
    public:
    TAvtoR();
    virtual ~TAvtoR();
    void DodRecord();
    void RedRecord();
    void DelRecord();
    void FindRecord(AnsiString NameField, AnsiString ValueField);
    };
    #endif
     
Загрузка...

Поделиться этой страницей