To get the length of a null-terminated LPTSTR in C or C++, use _tcslen, declared in TCHAR.H.
You wouldn't think I'd need to post this, but Google searches on lptstr null terminated length, lptstr strlen, lptstr string length, lptstr and lptstr length didn't turn up this information easily. Eventually I got it through lptstr string length msdn.

Comments