IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

MFC Discussion :

Question wxWidgets


Sujet :

MFC

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre éclairé
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Mai 2005
    Messages
    513
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mai 2005
    Messages : 513
    Par défaut Question wxWidgets
    Bonsoir a tous,
    voila j'essai de compiler depuis un moment maintenant un programme utilisant la librairie wxWidgets. J'ai réussi à enlever pas mal d'erreur lors de la compilation.
    Seulement il m'en reste une et je n'arrive pas à l'enlever. voici l'erreur indiqué:
    "error LNK2019: symbole externe non résolu _WinMain@16 référencé dans la fonction _WinMainCRTStartup"

    je sais que c'est parce qu'il manque un fichier lib, mais je n'arrive pas a savoir lequel. Pourriez vous m'aider svp?
    Merci par avance
    Bob

  2. #2
    mat.M
    Invité(e)
    Par défaut
    c'est tout c... : ou bien il manque WinMain ou bien il fait redondance
    Soit cocher la case "IGNORE DEFAULT LIBRARIES" je crois .

    Sinon prendre les exemples de WxWidgets déjà existant et regarder comment sont organisés les projets : llibs à inclure , option du project etc...
    Les exemples c'est pas fait pour faire décoratif !

  3. #3
    Membre éclairé
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Mai 2005
    Messages
    513
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mai 2005
    Messages : 513
    Par défaut
    bah je vais regarder du coté des exemples alors...
    mais les reres exemple de programme wxWidgets que j'ai vu, c'était juste un fichier cpp donc on ne voi pas le librairie qui sont ajouté !

  4. #4
    Expert confirmé

    Homme Profil pro
    pdg
    Inscrit en
    Juin 2003
    Messages
    5 756
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : France, Hérault (Languedoc Roussillon)

    Informations professionnelles :
    Activité : pdg

    Informations forums :
    Inscription : Juin 2003
    Messages : 5 756
    Billets dans le blog
    3
    Par défaut
    T'aurais pas oublié IMPLEMENT_APP(MyApp) ?

  5. #5
    Membre éclairé
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Mai 2005
    Messages
    513
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mai 2005
    Messages : 513
    Par défaut
    il est probable que ce soit a cause du IMPLEMENT_APP(MyApp).
    seulement je suis nouveau sous wxWidgets et je ne sais pas ou il faut le mettre.
    en fait le code de ma fenetre est généré automatiquement par un logiciel et il ne met met pas le IMPLEMENT_APP(MyApp). Et puis c'est quoi ce qu'il faut mettre entre parenthese ?

    voila le code généré par le programme pour ma fenetre:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    //------------------------------------------------------------------------------
    // Source code generated by wxDesigner from file: format_txt.wdr
    // Do not modify this file, all changes will be lost!
    //------------------------------------------------------------------------------
     
    #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
        #pragma implementation "format_txt_wdr.h"
    #endif
     
    // For compilers that support precompilation
    #include "wx/wxprec.h"
     
    #ifdef __BORLANDC__
        #pragma hdrstop
    #endif
     
    // Include private header
    #include "format_txt_wdr.h"
     
     
    // Euro sign hack of the year
    #if wxUSE_UNICODE
        #define __WDR_EURO__ wxT("\u20ac")
    #else
        #if defined(__WXMAC__)
            #define __WDR_EURO__ wxT("\xdb")
        #elif defined(__WXMSW__)
            #define __WDR_EURO__ wxT("\x80")
        #else
            #define __WDR_EURO__ wxT("\xa4")
        #endif
    #endif
     
    // Implement window functions
     
    wxSizer *MainDlgProc( wxWindow *parent, bool call_fit, bool set_sizer )
    {
        wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL );
     
        wxBoxSizer *item1 = new wxBoxSizer( wxHORIZONTAL );
     
        wxStaticLine *item2 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(400,-1), wxLI_HORIZONTAL );
        item1->Add( item2, 0, wxALIGN_CENTER|wxALL, 5 );
     
        item0->Add( item1, 0, wxALIGN_CENTER|wxALL, 5 );
     
        wxBoxSizer *item3 = new wxBoxSizer( wxHORIZONTAL );
     
        wxStaticText *item4 = new wxStaticText( parent, ID_TEXT, wxT("Fichier en entrée:"), wxDefaultPosition, wxSize(85,-1), wxALIGN_CENTRE );
        item3->Add( item4, 0, wxALIGN_CENTER|wxALL, 5 );
     
        wxStaticLine *item5 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(-1,20), wxLI_VERTICAL );
        item3->Add( item5, 0, wxALIGN_CENTER|wxALL, 5 );
     
        wxTextCtrl *item6 = new wxTextCtrl( parent, IDC_FILE_IN, wxT(""), wxDefaultPosition, wxSize(200,-1), 0 );
        item6->Enable( false );
        item3->Add( item6, 0, wxALIGN_CENTER|wxALL, 5 );
     
        wxStaticLine *item7 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(-1,20), wxLI_VERTICAL );
        item3->Add( item7, 0, wxALIGN_CENTER|wxALL, 5 );
     
        wxButton *item8 = new wxButton( parent, IDC_FILE_IN, wxT("Parcourir..."), wxDefaultPosition, wxDefaultSize, 0 );
        item3->Add( item8, 0, wxALIGN_CENTER|wxALL, 5 );
     
        item0->Add( item3, 0, wxALIGN_CENTER|wxALL, 5 );
     
        wxBoxSizer *item9 = new wxBoxSizer( wxHORIZONTAL );
     
        wxStaticText *item10 = new wxStaticText( parent, ID_TEXT, wxT("Fichier de sortie:"), wxDefaultPosition, wxSize(85,-1), wxALIGN_CENTRE );
        item9->Add( item10, 0, wxALIGN_CENTER|wxALL, 5 );
     
        wxStaticLine *item11 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(-1,20), wxLI_VERTICAL );
        item9->Add( item11, 0, wxALIGN_CENTER|wxALL, 5 );
     
        wxTextCtrl *item12 = new wxTextCtrl( parent, ID_TEXTCTRL, wxT(""), wxDefaultPosition, wxSize(200,-1), 0 );
        item9->Add( item12, 0, wxALIGN_CENTER|wxALL, 5 );
     
        wxStaticLine *item13 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(-1,20), wxLI_VERTICAL );
        item9->Add( item13, 0, wxALIGN_CENTER|wxALL, 5 );
     
        wxButton *item14 = new wxButton( parent, IDC_FILE_OUT, wxT("Parcourir..."), wxDefaultPosition, wxDefaultSize, 0 );
        item9->Add( item14, 0, wxALIGN_CENTER|wxALL, 5 );
     
        item0->Add( item9, 0, wxALIGN_CENTER|wxALL, 5 );
     
        wxBoxSizer *item15 = new wxBoxSizer( wxHORIZONTAL );
     
        wxStaticLine *item16 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(400,-1), wxLI_HORIZONTAL );
        item15->Add( item16, 0, wxALIGN_CENTER|wxALL, 5 );
     
        item0->Add( item15, 0, wxALIGN_CENTER|wxALL, 5 );
     
        wxBoxSizer *item17 = new wxBoxSizer( wxHORIZONTAL );
     
        wxButton *item18 = new wxButton( parent, IDC_FORMAT, wxT("Formater"), wxDefaultPosition, wxDefaultSize, 0 );
        item17->Add( item18, 0, wxALIGN_CENTER|wxALL, 5 );
     
        wxBoxSizer *item19 = new wxBoxSizer( wxHORIZONTAL );
     
        wxBoxSizer *item20 = new wxBoxSizer( wxHORIZONTAL );
     
        item19->Add( item20, 0, wxALIGN_CENTER|wxALL, 5 );
     
        wxBoxSizer *item21 = new wxBoxSizer( wxHORIZONTAL );
     
        item19->Add( item21, 0, wxALIGN_CENTER|wxALL, 5 );
     
        wxBoxSizer *item22 = new wxBoxSizer( wxHORIZONTAL );
     
        item19->Add( item22, 0, wxALIGN_CENTER|wxALL, 5 );
     
        wxBoxSizer *item23 = new wxBoxSizer( wxHORIZONTAL );
     
        item19->Add( item23, 0, wxALIGN_CENTER|wxALL, 5 );
     
        wxBoxSizer *item24 = new wxBoxSizer( wxHORIZONTAL );
     
        item19->Add( item24, 0, wxALIGN_CENTER|wxALL, 5 );
     
        wxBoxSizer *item25 = new wxBoxSizer( wxHORIZONTAL );
     
        item19->Add( item25, 0, wxALIGN_CENTER|wxALL, 5 );
     
        item17->Add( item19, 0, wxALIGN_CENTER|wxALL, 5 );
     
        wxButton *item26 = new wxButton( parent, IDC_QUITTER, wxT("Quitter"), wxDefaultPosition, wxDefaultSize, 0 );
        item17->Add( item26, 0, wxALIGN_CENTER|wxALL, 5 );
     
        item0->Add( item17, 0, wxALIGN_CENTER|wxALL, 5 );
     
        if (set_sizer)
        {
            parent->SetSizer( item0 );
            if (call_fit)
                item0->SetSizeHints( parent );
        }
     
        return item0;
    }
     
    // Implement menubar functions
     
    // Implement toolbar functions
     
    // Implement bitmap functions
     
     
    // End of generated file

  6. #6
    Expert confirmé

    Homme Profil pro
    pdg
    Inscrit en
    Juin 2003
    Messages
    5 756
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : France, Hérault (Languedoc Roussillon)

    Informations professionnelles :
    Activité : pdg

    Informations forums :
    Inscription : Juin 2003
    Messages : 5 756
    Billets dans le blog
    3
    Par défaut
    Tu dois avoir un (et un seul) objet application quelque part. C'est lui qui remplace main() en quelque sorte.
    Ton objet doit dériver de wxApp, dans mon exemple il s'appelle MyApp.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    class MyApp: public wxApp
    {
        virtual bool OnInit();
    };
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
     
    IMPLEMENT_APP(MyApp)
     
    bool MyApp::OnInit()
    {
        MyFrame *frame = new MyFrame( "Hello World", wxPoint(50,50), wxSize(450,340) );
        frame->Show( true );
        SetTopWindow( frame );
        return true;
    }
    http://www.wxwidgets.org/manuals/2.6.0/wx_helloworld.html#helloworld

  7. #7
    Membre éclairé
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Mai 2005
    Messages
    513
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mai 2005
    Messages : 513
    Par défaut
    oui mais tu ne m'as pas dit comment utiliser le code généré comme étant la fenetre principale de mon programme !

Discussions similaires

  1. [wxWidget] Quelques questions sur les wxMenuItem
    Par Electroniktor dans le forum wxWidgets
    Réponses: 6
    Dernier message: 10/05/2008, 23h14
  2. Questions générales que WxWidget
    Par mick009 dans le forum wxWidgets
    Réponses: 2
    Dernier message: 27/03/2008, 12h08
  3. Question sur wxWidget
    Par ZiMo dans le forum wxWidgets
    Réponses: 4
    Dernier message: 25/10/2005, 21h47
  4. Question de faisabilité
    Par lisarasu dans le forum CORBA
    Réponses: 3
    Dernier message: 14/05/2002, 11h26
  5. [HyperFile] 2 questions de débutant
    Par khan dans le forum HyperFileSQL
    Réponses: 2
    Dernier message: 29/04/2002, 23h18

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo