none
error C2653: 'CMessageLog' : is not a class or namespace name

    Question

  • I am getting the error "error C2653: 'CMessageLog' : is not a class or namespace name" while the following scenario:

     

    //MessageLog.h

     

    #include <afx.h>

     

    class CMessageLog

    {

    public:

    /**Message IDs for the Tool messages*/

    enum LogMessageID

    {

    MESSAGE_TYPE_NONE,

    MESSAGE_TYPE_INFO,

    MESSAGE_TYPE_ERROR,

    NUM_LOG_MESSAGES

    };

    }

    -----------------------------

     

    //Tool.h

     

    Public Tool:: public CwinApp

    {

    Public:

               void Fun1(MessageLog::LogMessageID logmsgID, std:Tongue Tiedtring& a_strMessage);

    }

     

    While trying to include "Tool.h" in to a new .cpp file of the form:

     

    // FilePathDialog.cpp, this files is generated by MFC with the base class od CDialog

     

    // FilePathDialog.cpp : implementation file

    //

    #include "stdafx.h"

    /* Here I am trying to include too.h */

    #include "tool.h"

    #include "FilePathDialog.h"

    #ifdef _DEBUG

    #define new DEBUG_NEW

    #undef THIS_FILE

    static char THIS_FILE[] = __FILE__;

    #endif

    /////////////////////////////////////////////////////////////////////////////

    // FilePathDialog dialog

     

    FilePathDialog::FilePathDialog(CWnd* pParent /*=NULL*/)

    : CDialog(FilePathDialog::IDD, pParent)

    {

    //{{AFX_DATA_INIT(FilePathDialog)

    // NOTE: the ClassWizard will add member initialization here

    //}}AFX_DATA_INIT

    }

     

    void FilePathDialog:Big SmileoDataExchange(CDataExchange* pDX)

    {

    CDialog:Big SmileoDataExchange(pDX);

    //{{AFX_DATA_MAP(FilePathDialog)

    // NOTE: the ClassWizard will add DDX and DDV calls here

    //}}AFX_DATA_MAP

    }

     

    BEGIN_MESSAGE_MAP(FilePathDialog, CDialog)

    //{{AFX_MSG_MAP(FilePathDialog)

    // NOTE: the ClassWizard will add message map macros here

    //}}AFX_MSG_MAP

    END_MESSAGE_MAP()

    /////////////////////////////////////////////////////////////////////////////

    // FilePathDialog message handlers

     

    Now the above said error is issued. Can anyone help me in solving this error, please?

     

     

     

     

     

    Tuesday, June 12, 2007 2:13 PM

Answers

All replies

  • #include messagelog.h in tool.h
    Tuesday, June 12, 2007 2:20 PM
  • Hello,

     

    Thank you very much for your quick response. Now that error is gone. Now I a getting another error: "error C2653: std' : is not a class or namespace name"

    What header file I need to include?
    Tuesday, June 12, 2007 2:37 PM
  • #include <string>

     

    If you get more errors like this, paste in the line that the error occurs on (double click the error in the output window to go to it).

    Tuesday, June 12, 2007 2:41 PM
  • Hi,

    Thanks for the help. Now it is working fine.

     

    Wednesday, June 13, 2007 9:35 AM