Click here to Skip to main content
15,900,816 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Multi Lingual GUI Pin
Rajesh R Subramanian3-Jan-07 20:05
professionalRajesh R Subramanian3-Jan-07 20:05 
QuestionRe: Multi Lingual GUI Pin
prasad_som3-Jan-07 20:05
prasad_som3-Jan-07 20:05 
AnswerRe: Multi Lingual GUI Pin
Hamid_RT3-Jan-07 20:04
Hamid_RT3-Jan-07 20:04 
Questionis there an api for... Pin
locoone3-Jan-07 17:15
locoone3-Jan-07 17:15 
AnswerRe: is there an api for... Pin
prasad_som3-Jan-07 18:31
prasad_som3-Jan-07 18:31 
GeneralRe: is there an api for... Pin
locoone6-Jan-07 15:53
locoone6-Jan-07 15:53 
AnswerRe: is there an api for... Pin
Hamid_RT4-Jan-07 5:40
Hamid_RT4-Jan-07 5:40 
QuestionCFile/CStdioFile Carriage return not being picked up Pin
devvvy3-Jan-07 14:58
devvvy3-Jan-07 14:58 
I serialized data to a file. Data file consists of many lines, so each has it's carriage return at the end. The problem is, the reader cannot pickup the carriage return. My observation is, when I open the file with Notepad++ or Wordpad, you can visually see the carriage return. When open with notepad (and my application's reader class), the carriage return isn't picked up.

Here's the code extract ...

1. Writing to data file

<br />
CFile oFile;<br />
oFile.Open("...", CFile::modeCreate|CFile::modeWrite|CFile::shareDenyWrite);<br />
<br />
for(int nIndex=0; nIndex<nSize; nIndex++) {<br />
			strLine = oLines.GetAt(nIndex);<br />
/*<br />
				WINBASEAPI<br />
				int<br />
				WINAPI<br />
				WideCharToMultiByte(<br />
					UINT     CodePage,<br />
					DWORD    dwFlags,<br />
					LPCWSTR  lpWideCharStr,<br />
					int      cchWideChar,<br />
					LPSTR    lpMultiByteStr,<br />
					int      cchMultiByte,<br />
					LPCSTR   lpDefaultChar,<br />
					LPBOOL   lpUsedDefaultChar);<br />
			*/<br />
			strLine += L"\n";<br />
			iLen = strLine.GetLength();<br />
			pMultiByteStr = new char[iLen]; <br />
			WideCharToMultiByte(CP_ACP, 0, (LPCWSTR) strLine.GetBuffer(iLen), -1, pMultiByteStr, iLen, "", &bUsedDefaultChar);<br />
			oFile.Write(pMultiByteStr, iLen);<br />
		}


2. Reading from data file [It simply read one line and exited]


<br />
int CSomeClass::ReadThisFile{<br />
	int iCount = 0;<br />
	CString sLine;<br />
        CStdioFile		oFile;<br />
<br />
	try<br />
	{<br />
		if (!OpenFile("..."))<br />
			return 0;<br />
<br />
		if (m_bHeaderRow)<br />
			oFile.ReadString(sLine);<br />
<br />
		while (oFile.ReadString(sLine))<br />
		{<br />
			// we ignore blank lines<br />
			if (sLine.GetLength() > 0)<br />
				iCount++;<br />
		}		<br />
		oFile.Close();<br />
	}<br />
	catch (...)<br />
	{<br />
		...<br />
	}<br />
<br />
	return iCount;<br />
}<br />


Any clue? Thanks
AnswerRe: Carriage return not being picked up Pin
Mark Salsbery3-Jan-07 15:04
Mark Salsbery3-Jan-07 15:04 
GeneralRe: Carriage return not being picked up Pin
devvvy3-Jan-07 15:28
devvvy3-Jan-07 15:28 
QuestionChoose the ''Stereo Min' now, how choose the 'microphone' Pin
MyNothing3-Jan-07 14:30
MyNothing3-Jan-07 14:30 
QuestionNeed to convert COLORREF to COLOR16 Pin
CoffeeAddict193-Jan-07 13:58
CoffeeAddict193-Jan-07 13:58 
AnswerRe: Need to convert COLORREF to COLOR16 Pin
Michael Dunn3-Jan-07 14:22
sitebuilderMichael Dunn3-Jan-07 14:22 
GeneralRe: Need to convert COLORREF to COLOR16 Pin
CoffeeAddict193-Jan-07 14:45
CoffeeAddict193-Jan-07 14:45 
GeneralRe: Need to convert COLORREF to COLOR16 Pin
Michael Dunn3-Jan-07 14:48
sitebuilderMichael Dunn3-Jan-07 14:48 
GeneralRe: Need to convert COLORREF to COLOR16 Pin
CoffeeAddict193-Jan-07 14:51
CoffeeAddict193-Jan-07 14:51 
AnswerRe: Need to convert COLORREF to COLOR16 Pin
Mark Salsbery3-Jan-07 15:00
Mark Salsbery3-Jan-07 15:00 
QuestionProblem with EndDialog Pin
Fernando A. Gomez F.3-Jan-07 13:18
Fernando A. Gomez F.3-Jan-07 13:18 
AnswerRe: Problem with EndDialog Pin
Mark Salsbery3-Jan-07 13:28
Mark Salsbery3-Jan-07 13:28 
QuestionRe: Problem with EndDialog Pin
Fernando A. Gomez F.3-Jan-07 13:31
Fernando A. Gomez F.3-Jan-07 13:31 
AnswerRe: Problem with EndDialog Pin
Mark Salsbery3-Jan-07 13:40
Mark Salsbery3-Jan-07 13:40 
GeneralRe: Problem with EndDialog Pin
Fernando A. Gomez F.3-Jan-07 13:55
Fernando A. Gomez F.3-Jan-07 13:55 
GeneralRe: Problem with EndDialog Pin
Mark Salsbery3-Jan-07 14:47
Mark Salsbery3-Jan-07 14:47 
GeneralRe: Problem with EndDialog Pin
Fernando A. Gomez F.4-Jan-07 8:07
Fernando A. Gomez F.4-Jan-07 8:07 
AnswerRe: Problem with EndDialog Pin
Michael Dunn3-Jan-07 14:24
sitebuilderMichael Dunn3-Jan-07 14:24 

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.