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

C / C++ / MFC

 
GeneralRe: Speech SDK Pin
Blake Miller2-Aug-05 4:34
Blake Miller2-Aug-05 4:34 
GeneralRe: Speech SDK Pin
alex__b2-Aug-05 4:43
professionalalex__b2-Aug-05 4:43 
GeneralEthernet/ network question Pin
Stan the man29-Jul-05 17:27
Stan the man29-Jul-05 17:27 
GeneralRe: Ethernet/ network question Pin
geo_m31-Jul-05 10:12
geo_m31-Jul-05 10:12 
GeneralRestricting area in editable HTML user can edit. Pin
David Fleming29-Jul-05 16:35
David Fleming29-Jul-05 16:35 
GeneralRe: Restricting area in editable HTML user can edit. Pin
David Fleming1-Aug-05 20:43
David Fleming1-Aug-05 20:43 
GeneralEdit Box Notification Pin
Member 12742129-Jul-05 14:13
Member 12742129-Jul-05 14:13 
GeneralRe: Edit Box Notification Pin
John R. Shaw29-Jul-05 14:29
John R. Shaw29-Jul-05 14:29 
GeneralRe: Edit Box Notification Pin
Stan the man29-Jul-05 17:13
Stan the man29-Jul-05 17:13 
GeneralVery very stupid question Pin
Lampros Giampouras29-Jul-05 12:53
Lampros Giampouras29-Jul-05 12:53 
GeneralRe: Very very stupid question Pin
John R. Shaw29-Jul-05 13:48
John R. Shaw29-Jul-05 13:48 
GeneralRe: Very very stupid question Pin
Toby Opferman29-Jul-05 14:00
Toby Opferman29-Jul-05 14:00 
GeneralRe: Very very stupid question Pin
John R. Shaw29-Jul-05 14:20
John R. Shaw29-Jul-05 14:20 
GeneralRe: Very very stupid question Pin
ThaSaVa30-Jul-05 0:01
ThaSaVa30-Jul-05 0:01 
GeneralRe: Very very stupid question Pin
Lampros Giampouras30-Jul-05 2:48
Lampros Giampouras30-Jul-05 2:48 
Generallocalizing problem Pin
Razi Al-Sayed29-Jul-05 9:53
Razi Al-Sayed29-Jul-05 9:53 
GeneralRe: localizing problem Pin
Michael Dunn29-Jul-05 19:09
sitebuilderMichael Dunn29-Jul-05 19:09 
Questioncomport; never reaches EOF? Pin
quarry_0629-Jul-05 9:15
quarry_0629-Jul-05 9:15 
Problem Solved. I was looking for the wrong EOF sign.

I have a while loop
bool fContinue = true;<br />
	do<br />
	{<br />
		// Wait for an event<br />
		lLastError = serial.WaitEvent();<br />

Inside this loop, I receive data and process it.
<br />
if (eEvent & CSerial::EEventRecv)<br />
		{<br />
			// Read data, until there is nothing left<br />
			DWORD dwBytesRead = 0;<br />
			char szBuffer[101];<br />
			do<br />
			{<br />
				// Read data from the COM-port<br />
				lLastError = serial.Read(szBuffer,sizeof(szBuffer)-1,&dwBytesRead);<br />
				if (lLastError != ERROR_SUCCESS)<br />
					return ::ShowError(serial.GetLastError(), _T("Unable to read from COM-port."));<br />
<br />
				if (dwBytesRead > 0)<br />
				{<br />
					// Finalize the data, so it is a valid string<br />
					szBuffer[dwBytesRead] = '\0';<br />
<br />
					// Display the data<br />
					printf("%s", szBuffer);<br />
					write2file(szBuffer);<br />
					<br />
					// Check if EOF (CTRL+'[') has been specified<br />
					if (strchr(szBuffer,EOF_Char))<br />
						fContinue = false;<br />
				}<br />
			}<br />
		    while (dwBytesRead == sizeof(szBuffer)-1);<br />
                   }<br />
	}<br />
while (fContinue);<br />


now what happens, that it somehow never sets fContinue to false.
but the first function I call, serial.WaitEvent();, doesn't get something either, and I can see that in fact all the expected data has arrived. Is it that code running on the other side of the comport does not send the proper EOF? or what could it be?

thanks for any suggestions
QuestionMFC Dll in non-MFC app? Pin
Anacreon29-Jul-05 7:55
Anacreon29-Jul-05 7:55 
AnswerOne other note Pin
Anacreon29-Jul-05 8:25
Anacreon29-Jul-05 8:25 
AnswerRe: MFC Dll in non-MFC app? Pin
Michael Dunn29-Jul-05 9:46
sitebuilderMichael Dunn29-Jul-05 9:46 
GeneralRe: MFC Dll in non-MFC app? Pin
Anacreon29-Jul-05 10:07
Anacreon29-Jul-05 10:07 
GeneralRe: MFC Dll in non-MFC app? Pin
Anacreon29-Jul-05 10:27
Anacreon29-Jul-05 10:27 
GeneralRe: MFC Dll in non-MFC app? Pin
Anacreon29-Jul-05 10:44
Anacreon29-Jul-05 10:44 
General#include problem Pin
massad29-Jul-05 6:03
massad29-Jul-05 6: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.