Accessing LPTSTR pointer string characters

I am using Visual Studio 2008 Express Edition with Windows 7 64 bit edition.

I want to write a sub-routine to scroll text passed to the subroutine via a LPTSTR pointer parameter.

The subroutine prototype is:-
 
void ScrollText(HDC hdc,int x,int y, LPTSTR string);


The intention is to print the string text to the window specified in the HDC command at the x and y co-ordinates passed to the subroutine.

The actual calling code looks like this:-
 
ScrollText(hdc,100,670,L"This is a demonstration of how to scroll text");


In the subroutine,I want to re-access the text associated with the pointer so that I can manipulate it with the C++ equivalent of Visual Basic's LEFT$,MID$ and RIGHT$ commands to create the effect of scrolling by constantly moving the left character of the string to the opposite end of the string and then re-displaying it on screen in a loop.

Unfortunately, at present I cannot find a character type or method to use to access the LPTSTR pointer text passed in the calling code.

Can anyone help please? TIA.
See http://msdn.microsoft.com/en-us/library/aa383751(v=vs.85).aspx
It might be the best idea to use microsoft typedefs when working with their typedefs.
Since you seem to have unicode on, LPTSTR is a WCHAR*. Everything is like with usual char*. If you want to use standard functions like strcmp or etc. I think there are equivalents with str replaced by wcs (like wcscmp, see http://msdn.microsoft.com/en-us/library/f0151s4x(v=vs.71).aspx )
Last edited on
Thanks for that, hamsterman. I've printed out the pages for the two links and I'll try using the WCHAR* and some of the wcs functions you suggest.Thanks again for your help.
Topic archived. No new replies allowed.