Click here to Skip to main content
15,886,017 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Is it possible to copy a data from

unsigned char pointer to LPCTSTR ??


LPCTSTR pBuf ;

pBuf ia a pointer for shared memory ,whenever I do the memory write , I'll increment the pBuf by 4.

I just want to reset the pointer(pBuf) to initial position(addr) at some point.

Does anybody know How to do that ??
Posted
Comments
CPallini 30-Mar-15 5:51am    
Of course it is possible. However it is not clear what do you really want to do.

1 solution

It is not possible using the LPCTSTR varaibale. It is const (Long Pointer Const TCHAR String: it is of type const TCHAR *). The compiler will generate an error when trying to copy data to such a pointer.

But you can assign the initial pointer value (reset the pointer) or cast it to another non-const variable (you should really know what you are doing when casting const to non-const).

You should explain with more detail what you want to do and what kind of data you want to copy.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900