Hi ,
I m struck up in a query . where i have to convert the wchar[] to char[] in vc++6.0 and pass the buffer over the TCP socket .

it is like this :

Client:-

CString csQuery=_T("C:\\精选图象件夹夹夹 \\ 精选图.txt"); //UTF-8
wchar_t wbuff[512];
for(int i=0;i<csQuery.GetLength();i++)
wbuff[i]=csQuery[i];
wbuff[i]='\0';

char buff[512];

--here i need to convert wbuff[] to char[] and pass it over the socket


int iSend=send(clisock, buff,sizeof(buff),0);

--
--
--


Server:-

here in server side, ill receive the buffer and need to convert the same to wide char (wchar_t[])

iRecv=recv(msgsock[id],buff,512,0);


---convert buff to wbuff

How can i do it?????


I have tried MultibytetoWideChar , WideChartoMultiByte but i dont know why it is not coming


Pls help me