Click here to Skip to main content
15,896,726 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: launch an html file Pin
David Crow27-Jul-05 5:23
David Crow27-Jul-05 5:23 
GeneralRe: launch an html file Pin
Halawlaws27-Jul-05 5:25
Halawlaws27-Jul-05 5:25 
GeneralRe: launch an html file Pin
David Crow27-Jul-05 5:27
David Crow27-Jul-05 5:27 
GeneralRe: launch an html file Pin
Halawlaws27-Jul-05 5:30
Halawlaws27-Jul-05 5:30 
GeneralRe: launch an html file Pin
David Crow27-Jul-05 5:36
David Crow27-Jul-05 5:36 
GeneralRe: launch an html file Pin
Halawlaws27-Jul-05 5:39
Halawlaws27-Jul-05 5:39 
GeneralRe: launch an html file Pin
David Crow27-Jul-05 5:44
David Crow27-Jul-05 5:44 
GeneralCOM PORT Does NOT receives all Data! Pin
tomek1827-Jul-05 4:21
tomek1827-Jul-05 4:21 
Confused | :confused: Confused | :confused: Confused | :confused: Hi...

My program is recieving data at 9600bytes (with standard settings), in chunks. 40 or more characters at a time. When the Data is displayed straight away on the screen, everything is cool.
But when I do simple calculations, it misses a lot of characters, and from 40 I might only recieve 20! and some characters turn to little squares.

I have tried reducing the amount of Data transfered to 5 characters, but even so it misses a few, without any pattern.

Is it possible to build a buffer quick enough to store all the 40 characters, then do the calculations of them.

Please give me some suggestions...

Here's part of my code.
void CChildView::SortData(LPCTSTR pszData)<br />
{<br />
<br />
	//copies pszData into buffer<br />
	TCHAR buffer[10];<br />
	_tcsncpy(buffer, pszData, 10);<br />
	<br />
	//converts UniCodeString to ASCII returns buffer<br />
	char AsciiStr[10];<br />
	WideCharToMultiByte (CP_ACP, 0, buffer, -1, AsciiStr, 10, NULL, NULL);<br />
<br />
	//testing, loop increments AsciiBuffer by 1 and stores AsciiStr in AsciiBuffer<br />
	static char AsciiBuffer[11] = "          ";<br />
	static int nPass=0;	<br />
<br />
	AsciiBuffer[nPass++] = AsciiStr[0];<br />
	<br />
	// when 10 characters are collected <br />
	if (nPass == 10)<br />
	{			<br />
	// saves data to a file, add's to exciting contents.<br />
		ofstream testFile( "test.txt", ios::app );<br />
			testFile << AsciiBuffer << " ";<br />
		testFile.close();<br />
		nPass =0;<br />
	}	<br />
	<br />
	//Displays Data in Window<br />
	DisplayData(pszData);<br />
}//end SortData



Maybe I should store the characters 1st, then convert into Ascii, But how do I convert an Array of Unicode into Ascii?

Thanks heaps!!!
GeneralRe: COM PORT Does NOT receives all Data! Pin
Marc Soleda27-Jul-05 5:27
Marc Soleda27-Jul-05 5:27 
Generalgeneral mfc question: lpszTemplateName Pin
23_44427-Jul-05 4:17
23_44427-Jul-05 4:17 
GeneralRe: general mfc question: lpszTemplateName Pin
David Crow27-Jul-05 5:05
David Crow27-Jul-05 5:05 
GeneralRe: general mfc question: lpszTemplateName Pin
23_44427-Jul-05 5:17
23_44427-Jul-05 5:17 
GeneralRe: general mfc question: lpszTemplateName Pin
David Crow27-Jul-05 5:31
David Crow27-Jul-05 5:31 
GeneralRe: general mfc question: lpszTemplateName Pin
23_44427-Jul-05 6:00
23_44427-Jul-05 6:00 
GeneralRe: general mfc question: lpszTemplateName Pin
David Crow27-Jul-05 6:09
David Crow27-Jul-05 6:09 
GeneralRe: general mfc question: lpszTemplateName Pin
23_44427-Jul-05 6:30
23_44427-Jul-05 6:30 
GeneralRe: general mfc question: lpszTemplateName Pin
David Crow27-Jul-05 7:03
David Crow27-Jul-05 7:03 
GeneralRe: general mfc question: lpszTemplateName Pin
23_44427-Jul-05 7:32
23_44427-Jul-05 7:32 
GeneralRe: general mfc question: lpszTemplateName Pin
Gary R. Wheeler27-Jul-05 12:48
Gary R. Wheeler27-Jul-05 12:48 
GeneralRe: general mfc question: lpszTemplateName Pin
23_44428-Jul-05 2:46
23_44428-Jul-05 2:46 
GeneralSerial Comms with 9-bit data Pin
button_basher27-Jul-05 4:01
button_basher27-Jul-05 4:01 
GeneralRe: Serial Comms with 9-bit data Pin
JWood27-Jul-05 9:30
JWood27-Jul-05 9:30 
GeneralRe: Serial Comms with 9-bit data Pin
button_basher28-Jul-05 2:16
button_basher28-Jul-05 2:16 
GeneralThe message when the dialog is covered Pin
jerome_data27-Jul-05 3:40
jerome_data27-Jul-05 3:40 
GeneralRe: The message when the dialog is covered Pin
David Crow27-Jul-05 4:03
David Crow27-Jul-05 4:03 

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.