 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Chat Guest
|
Posted: Fri Apr 02, 2004 1:31 pm Post subject: pb reference d'objet et initialisation |
|
|
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
|
Posted: Fri Apr 02, 2004 9:15 pm Post subject: Re: pb reference d'objet et initialisation |
|
|
Chat <chat (AT) nospam (DOT) com> écrivait:
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 |
|
 |
|
|
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
|
|