Click to See Complete Forum and Search --> : LPCTSTR to unsigned short*


February 23rd, 2000, 01:16 PM
Actually I need to convert say "C:\Windows\abc.gif" to an (unsigned short*)

My understanding is that with VC5 and before it worked fine, but now in VC6, MS has moved closer to the official standards and taken it away.

My problem is that the AniGIF ocx uses a (unsigned short*) parameter for the name of a file you want to display. I am also using ATL so an MFC CString solution isn't on the cards.

Thanks in Advance

Andrew

Xenofon
February 23rd, 2000, 02:21 PM
Just cast it to the desired type, like this


char buffer[128];
short int *p;
strcpy(buffer,"c:\\images\\myimage.gif"); //put whatever you want in buffer
p=(short int*)buffer;

Sesha
February 23rd, 2000, 03:29 PM
Try something like MultiByteToWideChar().