I'm trying to replace the AnsiNext function, which is obsolete, by incrementing the pointer in a Charles Petzold program.
But it keeps crashing on the pointer incrementation: .
What could be the cause?
Code:
static char * pText = (char *) LockResource (hResource) ;
iNumLines = 0 ;
while (*pText != '\\' && *pText != '\0')
{
if (*pText == '\n')
{
iNumLines++;
}
//pText = AnsiNext (pText) ;
(*pText)++;
}
*pText = '\0' ;
SetScrollRange (hScroll, SB_CTL, 0, iNumLines, FALSE) ;
SetScrollPos (hScroll, SB_CTL, 0, FALSE) ;
return 0 ;