Article ID: 104649
Article Last Modified on 7/5/2005
/* Compile options needed: none
*/
#include <afxwin.h> // MFC core and standard components
class CTestApp : public CWinApp
{
public:
CTestApp();
};
CTestApp::CTestApp()
{
}
CTestApp NEAR theApp;
LPSTR FunctionName (char* pszFileName)
{
DWORD dwMaxLength;
unsigned int nChars;
LPSTR LpSrc, lpDst, lpNew;
static char szPath [_MAX_PATH];
while (*LpSrc)
{
switch (*LpSrc)
{
case ('\\'):
case ('/'):
*lpDst++ = *LpSrc++;
nChars = 0;
break ;
case ('<'):
case ('>'):
case ('"'):
case ('|'):
ASSERT (FALSE);
LpSrc++;
break;
default:
if (nChars < dwMaxLength)
*lpDst++ = *LpSrc++;
else
LpSrc++;
nChars++;
break;
// Without the following closing brace for the switch
// statement, the compiler issues the C1001 error or hangs
// instead of generating the appropriate syntax error message.
//}
}
return lpNew;
}
Additional query words: 1.00 1.50 8.00 8.00c curly
Keywords: kbbug kbfix kbcpponly kbcompiler KB104649