Click here to Skip to main content
15,921,113 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionMixed UCS-2 and 1-byte ASCII characters Pin
jones1668-Mar-07 1:41
jones1668-Mar-07 1:41 
AnswerRe: Mixed UCS-2 and 1-byte ASCII characters Pin
Nemanja Trifunovic8-Mar-07 1:51
Nemanja Trifunovic8-Mar-07 1:51 
GeneralRe: Mixed UCS-2 and 1-byte ASCII characters Pin
jones1668-Mar-07 2:10
jones1668-Mar-07 2:10 
GeneralRe: Mixed UCS-2 and 1-byte ASCII characters Pin
Nemanja Trifunovic8-Mar-07 2:36
Nemanja Trifunovic8-Mar-07 2:36 
QuestionHow to check extended style of List View? Pin
Aryan S8-Mar-07 1:39
Aryan S8-Mar-07 1:39 
AnswerRe: How to check extended style of List View? Pin
vibindia8-Mar-07 2:05
vibindia8-Mar-07 2:05 
QuestionGetting the IE cache entry of the image displayed in the IE Pin
Suyash8-Mar-07 1:05
Suyash8-Mar-07 1:05 
Questiongarbage value problem???? Pin
amitmistry_petlad 8-Mar-07 0:39
amitmistry_petlad 8-Mar-07 0:39 
when source pass with null value the len will be 0.
but due to effect of that tempOutFile create the garbage value I need to clear it with null value.
<code>
string Utility::ConvertWCHARToString(LPCWSTR source) //source=""
{
	try
	{
		size_t len = wcslen(source) * sizeof(LPCWSTR);	//len=0	 
		char* tempOutFile= new char[len];//tempOutFile=Garbage valve need tempOutFile =""		 </code>   
		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;
	}
}


I have try to intialize the value explicitly but it didn't work(crash application).
like

if(len==0)
tempOutFile=NULL;
AnswerRe: garbage value problem???? Pin
prasad_som8-Mar-07 0:46
prasad_som8-Mar-07 0:46 
GeneralRe: garbage value problem???? Pin
amitmistry_petlad 8-Mar-07 0:54
amitmistry_petlad 8-Mar-07 0:54 
AnswerRe: garbage value problem???? Pin
prasad_som8-Mar-07 1:29
prasad_som8-Mar-07 1:29 
GeneralRe: garbage value problem???? Pin
amitmistry_petlad 8-Mar-07 2:39
amitmistry_petlad 8-Mar-07 2:39 
AnswerRe: garbage value problem???? Pin
prasad_som8-Mar-07 2:51
prasad_som8-Mar-07 2:51 
AnswerRe: garbage value problem???? Pin
krmed8-Mar-07 2:58
krmed8-Mar-07 2:58 
Questionmemcpy related Pin
NiceNaidu8-Mar-07 0:37
NiceNaidu8-Mar-07 0:37 
AnswerRe: memcpy related Pin
Vinod Sankaranarayanan8-Mar-07 1:30
Vinod Sankaranarayanan8-Mar-07 1:30 
GeneralRe: memcpy related Pin
toxcct8-Mar-07 1:40
toxcct8-Mar-07 1:40 
GeneralRe: memcpy related Pin
Nemanja Trifunovic8-Mar-07 2:00
Nemanja Trifunovic8-Mar-07 2:00 
GeneralRe: memcpy related Pin
toxcct8-Mar-07 2:12
toxcct8-Mar-07 2:12 
GeneralRe: memcpy related Pin
Nemanja Trifunovic8-Mar-07 2:58
Nemanja Trifunovic8-Mar-07 2:58 
GeneralRe: memcpy related Pin
PJ Arends8-Mar-07 5:00
professionalPJ Arends8-Mar-07 5:00 
GeneralRe: memcpy related Pin
toxcct8-Mar-07 5:45
toxcct8-Mar-07 5:45 
AnswerRe: memcpy related Pin
prasad_som8-Mar-07 1:34
prasad_som8-Mar-07 1:34 
GeneralRe: memcpy related Pin
NiceNaidu8-Mar-07 2:21
NiceNaidu8-Mar-07 2:21 
QuestionWaitForMultipleObjects Pin
Shaileshhex8-Mar-07 0:35
Shaileshhex8-Mar-07 0:35 

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.