Code de base pour wxWidget
Bonjour tout le monde. Je suis le petit nouveau.
Bon, j'ai un problème. Je débute dans wxWidget et mon code de départ ne fonctionne pas. Ca fait 4H que je cherche et je ne trouve pas. Pouvez-vous m'aider s'il vous plaît?
myftpapp.cpp
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| #include "wx/wxprec.h"
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
#include "myftpapp.h"
#include "myftpframe.h"
IMPLEMENT_APP(wxMyFTPApp);
wxMyFTPApp::wxMyFTPApp() : wxApp()
{
}
bool wxMyFTPApp::OnInit()
{
wxApp::OnInit();
wxMyFTPFrame* mainWindow = new wxMyFTPFrame(NULL);
mainWindow->SetSize(wxSize(640, 480));
mainWindow->Show(true);
return true;
} |
myftpapp.h
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| #ifndef _MYFTPAPP_H_
#define _MYFTPAPP_H_
class wxMyFTPApp : public wxApp
{
public:
wxMyFTPApp();
virtual bool OnInit();
};
DECLARE_APP(wxMyFTPApp);
#endif |
myftpframe.cpp
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| #include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
#include "myftpframe.h"
wxMyFTPFrame::wxMyFTPFrame(wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style)
{
Create(parent, id, caption, pos, size, style);
}
wxMyFTPFrame::~wxMyFTPFrame()
{
}
bool Create(wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style)
{
wxFrame::Create(parent, id, caption, pos, size, style);
return true;
} |
myftpframe.h
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| #ifndef _MYFTPFRAME_H_
#define _MYFTPFRAME_H_
class wxMyFTPFrame : public wxFrame
{
public:
wxMyFTPFrame(wxWindow* parent, wxWindowID id = -1, const wxString& caption = _("MyFTP v0.1"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE);
~wxMyFTPFrame();
bool Create(wxWindow* parent, wxWindowID id = -1, const wxString& caption = _("MyFTP v0.1"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE);
};
#endif |
S'il vous plaît aider moi, je commance à désespérer.
P.S : Je n'ai que 13 ans.
EDIT : J'ai oublier de montrer les erreurs du compilateur
cannot call member function `bool wxFrame::Create(wxWindow*, wxWindowID, const wxString&, const wxPoint&, const wxSize&, long int, const wxString&)' without object