Convert LPBYTE to some kind of string

Below is part of my program code .
WHat i want do :
For now i check if some byte (i use [number] for shift) from ptr contains specific ascii character. If yes i do something.
When i am in debugging mode and i am above ptr i see that ptr contains a string.
For example
ptr = 0x0354a9e8 "ýýýýÝÝÝ äŃ."

When i call ptr[0]==27 i check if 1st sign in this string is escape. but i really cant find a solution how to iterate this string and try to find some char. For now i must use index, but i want to do something like:
for(i = 0;i<=CountOfCharInString;i++)
{
if (ptr[i]==mySign)
{
Do Something
}
}


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
LPBYTE ptr = (LPBYTE) p + sizeof(IOReq);
				DWORD Size = ((IOReq *)p)->SizeCopied;
				switch (printer)
				{
					case PRINTER_THERMAL:
						if (ptr[0] == 27 && ptr[1]==80 && ptr[2]==49 && ptr[3]== 59 &&  ptr[5]==59)
						{
							DoTrigger();
						}
						break;
					case PRINTER_ELZAB:
						if (ptr[0]== 27 && ptr[1] == 7)
						{
						DoTrigger();
						}
						break;
					case PRINTER_NONE:
						delete []p;
						return GO_ERR_PRINTER_NONE;
						break;
					default:
						delete []p;
						return GO_ERR_PRINTER_UNKNOWN;
						break;
				}
Topic archived. No new replies allowed.