标题:MFC一个小问题,大侠进来瞧瞧………………先谢过了
只看楼主
a632034079
Rank: 2
等 级:论坛游民
帖 子:115
专家分:34
注 册:2009-10-3
结帖率:86.11%
 问题点数:0 回复次数:0 
MFC一个小问题,大侠进来瞧瞧………………先谢过了
这个错误怎么解决啊!换了字符串名也没用啊………………大侠帮帮忙回答下………………

--------------------Configuration: Ch6Demo1 - Win32 Debug--------------------
Compiling resources...
F:\VC98\MFC\INCLUDE/l.chs\afxres.rc (120): error RC2151 : cannot reuse string constants, 61446(0xF006) - "11:20:07" already defined. Cannot add 61446(0xF006) - "一未命名文件".
执行 rc.exe 时出错.

Ch6Demo1.exe - 1 error(s), 0 warning(s)




#include "stdafx.h"
#include "Ch6Demo1.h"

#include "MainFrm.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMainFrame

IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)

BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
    //{{AFX_MSG_MAP(CMainFrame)
    ON_WM_CREATE()
    ON_WM_TIMER()
    //}}AFX_MSG_MAP
END_MESSAGE_MAP()

static UINT indicators[] =
{
    ID_SEPARATOR,           // status line indicator
    ID_INDICATOR_CAPS,
    ID_INDICATOR_ NUM,
    ID_INDICATOR_SCRL,
    ID_INDICATOR_SJIAN
};

/////////////////////////////////////////////////////////////////////////////
// CMainFrame construction/destruction

CMainFrame::CMainFrame()
{
    // TODO: add member initialization code here
   
}

CMainFrame::~CMainFrame()
{
}

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
        return -1;
   
    if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
        | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
        !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
    {
        TRACE0("Failed to create toolbar\n");
        return -1;      // fail to create
    }

    if (!m_wndStatusBar.Create(this) ||
        !m_wndStatusBar.SetIndicators(indicators,
          sizeof(indicators)/sizeof(UINT)))
    {
        TRACE0("Failed to create status bar\n");
        return -1;      // fail to create
    }

    // TODO: Delete these three lines if you don't want the toolbar to
    //  be dockable
    m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
    EnableDocking(CBRS_ALIGN_ANY);
    DockControlBar(&m_wndToolBar);
   
    SetTimer(1,1000,NULL);
    return 0;
}

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
    if( !CFrameWnd::PreCreateWindow(cs) )
        return FALSE;
    // TODO: Modify the Window class or styles here by modifying
    //  the CREATESTRUCT cs

    return TRUE;
}

/////////////////////////////////////////////////////////////////////////////
// CMainFrame diagnostics

#ifdef _DEBUG
void CMainFrame::AssertValid() const
{
    CFrameWnd::AssertValid();
}

void CMainFrame::Dump(CDumpContext& dc) const
{
    CFrameWnd::Dump(dc);
}

#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CMainFrame message handlers


void CMainFrame::OnTimer(UINT nIDEvent)
{
    // TODO: Add your message handler code here and/or call default
    CTime t1;
    t1 = CTime::GetCurrentTime();
    CString s;
    s = t1.Format("%H:%M:%S");
    m_wndStatusBar.SetPaneText(4,s);
    CFrameWnd::OnTimer(nIDEvent);
}



搜索更多相关主题的帖子: MFC 
2010-01-26 11:14



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-296505-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.024609 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved