请问它们错在哪里了
AfxCore.cpp文件中,下列二个函数存在问题.
按F10的时候,接收到个股资料无法读出. 如000001的资料,保存的文件名是01.txt,
即也就是只取代码的后2位构成文件名!
CString AfxGetFileTitle( LPCTSTR lpszPathName )
{
CString strPathName = lpszPathName;
if( strPathName.IsEmpty() )
return "";
UINT nTitleLen = AfxGetFileTitle( strPathName, NULL, 0 );
if( nTitleLen <= 0 || nTitleLen-1 > (UINT)strPathName.GetLength() )
return "";
CString strTitle = strPathName.Right( nTitleLen-1 );
return strTitle;
}
CString AfxGetFileTitleNoExt( LPCTSTR lpszPathName )
{
CString strPathName = lpszPathName;
if( strPathName.IsEmpty() )
return "";
UINT nTitleLen = AfxGetFileTitle( strPathName, NULL, 0 );
if( nTitleLen <= 0 || nTitleLen-1 > (UINT)strPathName.GetLength() )
return "";
CString strTitle = strPathName.Right( nTitleLen-1 );
int nIndex = strTitle.ReverseFind( '.' );
if( -1 != nIndex )
strTitle = strTitle.Left( nIndex );
return strTitle;
}