C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

pb reference d'objet et initialisation

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ (French)
View previous topic :: View next topic  
Author Message
Chat
Guest





PostPosted: Fri Apr 02, 2004 1:31 pm    Post subject: pb reference d'objet et initialisation Reply with quote



bonjour,
voila le code suivant


//////******* premier fichier .h


#ifndef _MYTHREAD_H
#define _MYTHREAD_H

#include "wx/thread.h"
#include "wx/window.h"



class MyPanel;


class MyThread : public wxThread
{
public:
MyThread(MyPanel &panel,wxWindow *mainWindow);
virtual void *Entry();
virtual void OnExit();
virtual void *MyThread::Pause();
virtual void MyThread::Resume();
virtual bool MyThread::IsPaused();
void execMyFunctions();
virtual ~MyThread();

public:
int l_cpt;
int flag;

MyPanel &m_panel;
wxWindow *m_Window;
};


le fichier cpp associé

#include "MyThread.h"
#include "wx/msgdlg.h"


MyThread::MyThread(MyPanel &panel,wxWindow *mainWindow)
: wxThread(wxTHREAD_JOINABLE),m_panel(panel)
{
l_cpt=0;
MyThread::flag=0;
MyThread::m_Window=mainWindow;
}


void *MyThread::Entry()
{
//**** plein de code....

LE PROBLEME EST LA <------------------------

m_panel->une_methode_publique_de_la_classe_MyPanel();
//JE NE PEUX INVOQUER AUCUNE METHODE DE LA CLASSE MYPANEL
il me dit ; "use of undefined type 'MyPanel'"

je comprends pas ou est l'erreur sachant que je ne peux pas mettre
d'include de la classe MyPanel puisqu'elle est definie dans le fichier
principal ( .cpp), et la classe MyPanel utilise justement la classe MyThread
pouvez vous m'aider???
}

merci

Back to top
Franck Branjonneau
Guest





PostPosted: Fri Apr 02, 2004 9:15 pm    Post subject: Re: pb reference d'objet et initialisation Reply with quote



Chat <chat (AT) nospam (DOT) com> écrivait:

Quote:
bonjour,

Bonjour,

Quote:
voila le code suivant

[...]

LE PROBLEME EST LA <------------------------

m_panel->une_methode_publique_de_la_classe_MyPanel();
//JE NE PEUX INVOQUER AUCUNE METHODE DE LA CLASSE MYPANEL
il me dit ; "use of undefined type 'MyPanel'"

Comment le compilateur pourrait-il invoquer une fonction membre (le
C++ ne connaît pas de méthode) de la classe MyPanel dont il ne sait
rien ?

Quote:
je comprends pas ou est l'erreur sachant que je ne peux pas mettre
d'include de la classe MyPanel puisqu'elle est definie dans le fichier
principal ( .cpp), et la classe MyPanel utilise justement la classe
MyThread

Il te faut réorganiser ton code.
--
Franck Branjonneau <fasbjx (AT) free (DOT) fr>

Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ (French) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.