Click to See Complete Forum and Search --> : HELP!


May 31st, 1999, 08:50 AM
I have two classes,

class Classone : public CDialog
{
private :
CStrings etc...
void stop();
Public :
other stuff ();
}

class ClassTwo : public CDialog
{
private :
CStrings stuff, etc...
public :
ClassTwo(const char *pFileName, CWnd* pParent = NULL);

protected :
afx_msg void OnStart();
}

How can I call OnStart() from Stop() ????

Chris Wheeler
May 31st, 1999, 09:07 AM
In ClassTwo, create a public member function that calls OnStart(). Then call that member function from Stop() in ClassOne. I think you can move the declaration of the message handler OnStart() into a public section, but that is not recommended.

Chris R. Wheeler, MCP
Pensacola Christian College
Desktop Programmer
cwheeler@pcci.edu

May 31st, 1999, 09:16 AM
Do I call this by doing this :

ClassTwo :: CallOnStart();

I keep getting : illegal call of non-static member function

:-(

Chris Wheeler
May 31st, 1999, 09:46 AM
True. I forgot about that and assumed you had an instance of ClassTwo. Try putting static in front of the declaration of CallOnStart() and maybe that'll help. (I'm fairly new to VC++ 6 and have never actually tried to create a static function, but that is the simply theory of it. :-)

Chris R. Wheeler, MCP
Pensacola Christian College
Desktop Programmer
cwheeler@pcci.edu

May 31st, 1999, 09:56 AM
nope, same thing, this problem has been holding me up for 3 days now, it seems simple but its causing me much distress!!!! Thanks for the suggestions!!! Any help is much appreciated!!