CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: HELP!

  1. #1
    Guest

    HELP!

    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() ????



  2. #2
    Join Date
    May 1999
    Posts
    28

    Re: HELP!

    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
    [email protected]

  3. #3
    Guest

    Re: HELP!

    Do I call this by doing this :

    ClassTwo :: CallOnStart();

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

    :-(


  4. #4
    Join Date
    May 1999
    Posts
    28

    Re: HELP!

    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
    [email protected]

  5. #5
    Guest

    Re: HELP!

    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!!


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured