Click here to Skip to main content
15,923,051 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: icon to bitmap conversion Pin
David Crow27-Jul-05 7:58
David Crow27-Jul-05 7:58 
Generalre: interface of TSP using GA Pin
partas27-Jul-05 5:03
partas27-Jul-05 5:03 
GeneralRe: re: interface of TSP using GA Pin
Blake Miller27-Jul-05 9:13
Blake Miller27-Jul-05 9:13 
GeneralRe: re: interface of TSP using GA Pin
partas28-Jul-05 21:04
partas28-Jul-05 21:04 
GeneralRe: re: interface of TSP using GA Pin
Blake Miller29-Jul-05 4:10
Blake Miller29-Jul-05 4:10 
Generallaunch an html file Pin
Halawlaws27-Jul-05 4:49
Halawlaws27-Jul-05 4:49 
GeneralRe: launch an html file Pin
David Crow27-Jul-05 4:51
David Crow27-Jul-05 4:51 
GeneralRe: launch an html file Pin
Halawlaws27-Jul-05 4:53
Halawlaws27-Jul-05 4:53 
GeneralRe: launch an html file Pin
David Crow27-Jul-05 5:00
David Crow27-Jul-05 5:00 
GeneralRe: launch an html file Pin
Halawlaws27-Jul-05 5:02
Halawlaws27-Jul-05 5:02 
GeneralRe: launch an html file Pin
David Crow27-Jul-05 5:07
David Crow27-Jul-05 5:07 
GeneralRe: launch an html file Pin
Halawlaws27-Jul-05 5:08
Halawlaws27-Jul-05 5:08 
GeneralRe: launch an html file Pin
David Crow27-Jul-05 5:13
David Crow27-Jul-05 5:13 
GeneralRe: launch an html file Pin
Halawlaws27-Jul-05 5:17
Halawlaws27-Jul-05 5:17 
GeneralRe: launch an html file Pin
Ravi Bhavnani27-Jul-05 5:22
professionalRavi Bhavnani27-Jul-05 5:22 
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 

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.