单文档的标题怎么改呀?高手指点:)
总是“无标题” 问题点数:20、回复次数:5Top
1 楼zwvista(球迷程序员)回复于 2002-11-20 14:48:35 得分 0
说说具体要求
Top
2 楼ruihuahan(飞不起来的笨鸟)回复于 2002-11-20 14:53:20 得分 0
用它:
CDocument::SetTitle();Top
3 楼Saimen(沉默是金)回复于 2002-11-20 15:00:24 得分 10
void CWebSeverDoc::SetTitle(LPCTSTR lpszTitle)
{
CString strTitle;
if ( lpszTitle != NULL )
m_strTitleBase = lpszTitle;
if ( m_strServer.IsEmpty() )
strTitle = m_strTitleBase;
else if ( m_pListen == NULL )
strTitle.Format( IDS_INVALID, m_strTitleBase );
else
{
if ( m_uPort != PORT_HTTP )
strTitle.Format( IDS_DOCTITLE, m_strTitleBase, m_strServer, m_uPort );
else
strTitle.Format( IDS_DOCTITLE_NOPORT, m_strTitleBase, m_strServer );
}
CDocument::SetTitle( strTitle );
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
}Top
4 楼Saimen(沉默是金)回复于 2002-11-20 15:06:46 得分 0
void CWebSeverDoc::SetTitle(LPCTSTR lpszTitle)
{
CString strTitle;
if ( lpszTitle != NULL )
m_strTitleBase = lpszTitle;
if ( m_strServer.IsEmpty() )
strTitle = m_strTitleBase;
else if ( m_pListen == NULL )
strTitle.Format( IDS_INVALID, m_strTitleBase );
else
{
if ( m_uPort != PORT_HTTP )
strTitle.Format( IDS_DOCTITLE, m_strTitleBase, m_strServer, m_uPort );
else
strTitle.Format( IDS_DOCTITLE_NOPORT, m_strTitleBase, m_strServer );
}
CDocument::SetTitle( strTitle );
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
}Top
5 楼happydou(豆豆)回复于 2002-11-20 15:20:37 得分 10
// CLog_interfaceDoc commands
void CLog_interfaceDoc::SetTitle(LPCTSTR lpszTitle)
{
// TODO: Add your specialized code here and/or call the base class
CString Wintitle;
Wintitle = "网络";
lpszTitle = (LPCTSTR)Wintitle;
CDocument::SetTitle(lpszTitle);
}
CLog_interfaceDoc再你的程序中就是你的doc文件类,这样设置后你的文档标题是"网络"Top




