Click here to Skip to main content
15,908,015 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Bitmap Pin
Sangeetha_J22-Jan-07 19:19
Sangeetha_J22-Jan-07 19:19 
GeneralRe: Bitmap Pin
Hamid_RT22-Jan-07 19:42
Hamid_RT22-Jan-07 19:42 
AnswerRe: Bitmap Pin
John R. Shaw21-Jan-07 0:19
John R. Shaw21-Jan-07 0:19 
GeneralRe: Bitmap Pin
Sangeetha_J21-Jan-07 19:11
Sangeetha_J21-Jan-07 19:11 
QuestionWindows delayed write failed Pin
mt_samiei19-Jan-07 23:15
mt_samiei19-Jan-07 23:15 
AnswerRe: Windows delayed write failed Pin
Mark Salsbery20-Jan-07 6:04
Mark Salsbery20-Jan-07 6:04 
AnswerRe: Windows delayed write failed Pin
Hamid_RT20-Jan-07 6:07
Hamid_RT20-Jan-07 6:07 
Questionmy code is not working for WCHAR to string Pin
amitmistry_petlad 19-Jan-07 22:44
amitmistry_petlad 19-Jan-07 22:44 
<code>
	WCHAR szBuff[5000]={};	

	bool bSucced=ReadFile(hFile,&szBuff,5000,&dwRecvLen,NULL);	
	szBuff[dwRecvLen] = '\0';	
	CloseHandle(hFile);	
		
	Utility util;	
	string str1=util.ConvertWCHARToString(szBuff); 
</code>



<code>
string Utility::ConvertWCHARToString(LPCWSTR source)
{
	try
	{
		size_t len = wcslen(source) * sizeof(LPCWSTR);
		char* tempOutFile = new char[len];
		WideCharToMultiByte(CP_ACP,0,source,-1,tempOutFile,(int)len,NULL,NULL);
		string s = tempOutFile;
		if(tempOutFile)
		{
			delete[] tempOutFile;
		}
		return s;
	}
	catch(exception ex)
	{
		throw ex;
	}
}

</code>


when i debug it.it gives me the ? questionmark after (return)conversion.
i have also tried directly WideCharToMultiByte but it also gives the same error ? mark .
i have replace LPCWSTR to WCHAR but didn't work.

basically this conversion is need to print the string value in listview control



Amit
AnswerRe: my code is not working for WCHAR to string Pin
Christian Graus19-Jan-07 23:16
protectorChristian Graus19-Jan-07 23:16 
AnswerRe: my code is not working for WCHAR to string Pin
Michael Dunn20-Jan-07 9:40
sitebuilderMichael Dunn20-Jan-07 9:40 
QuestionHelp me in creating a control Pin
Raj Prathap19-Jan-07 21:38
Raj Prathap19-Jan-07 21:38 
AnswerRe: Help me in creating a control Pin
Waldermort19-Jan-07 22:31
Waldermort19-Jan-07 22:31 
AnswerRe: Help me in creating a control Pin
ThatsAlok19-Jan-07 22:37
ThatsAlok19-Jan-07 22:37 
AnswerRe: Help me in creating a control Pin
Joan M20-Jan-07 5:44
professionalJoan M20-Jan-07 5:44 
AnswerRe: Help me in creating a control Pin
Hamid_RT20-Jan-07 6:06
Hamid_RT20-Jan-07 6:06 
QuestionLook for a powerful datagrid control for VC++ Pin
liur1719-Jan-07 19:45
liur1719-Jan-07 19:45 
AnswerRe: Look for a powerful datagrid control for VC++ Pin
Rajesh R Subramanian19-Jan-07 20:30
professionalRajesh R Subramanian19-Jan-07 20:30 
GeneralRe: Look for a powerful datagrid control for VC++ Pin
ThatsAlok19-Jan-07 22:37
ThatsAlok19-Jan-07 22:37 
AnswerRe: Look for a powerful datagrid control for VC++ Pin
ThatsAlok19-Jan-07 22:38
ThatsAlok19-Jan-07 22:38 
GeneralRe: Look for a powerful datagrid control for VC++ Pin
liur1720-Jan-07 2:16
liur1720-Jan-07 2:16 
Questionerror compiliing pwlib Pin
Kiran Pinjala19-Jan-07 19:11
Kiran Pinjala19-Jan-07 19:11 
AnswerRe: error compiliing pwlib Pin
ThatsAlok19-Jan-07 23:06
ThatsAlok19-Jan-07 23:06 
GeneralRe: error compiliing pwlib Pin
Kiran Pinjala19-Jan-07 23:30
Kiran Pinjala19-Jan-07 23:30 
QuestionWinHTTP Pin
shadrach_india19-Jan-07 18:51
shadrach_india19-Jan-07 18:51 
AnswerRe: WinHTTP Pin
Mark Salsbery20-Jan-07 6:06
Mark Salsbery20-Jan-07 6:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.