Click here to Skip to main content
15,891,864 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: files to include while creating setup Pin
Tara1426-Jul-06 17:04
Tara1426-Jul-06 17:04 
AnswerRe: files to include while creating setup Pin
prasad_som26-Jul-06 19:41
prasad_som26-Jul-06 19:41 
GeneralRe: files to include while creating setup Pin
Tara1426-Jul-06 19:47
Tara1426-Jul-06 19:47 
GeneralRe: files to include while creating setup Pin
prasad_som26-Jul-06 20:36
prasad_som26-Jul-06 20:36 
GeneralRe: files to include while creating setup Pin
Tara1426-Jul-06 20:47
Tara1426-Jul-06 20:47 
GeneralRe: files to include while creating setup Pin
prasad_som26-Jul-06 21:05
prasad_som26-Jul-06 21:05 
GeneralRe: files to include while creating setup Pin
Tara1426-Jul-06 21:43
Tara1426-Jul-06 21:43 
QuestionProblem with CString! CXX0017 Pin
tanarnelinistit26-Jul-06 1:37
tanarnelinistit26-Jul-06 1:37 
I use the folowing code to listen the com:

void CMina_sView::OnListenCom1() <br />
{	<br />
     running = TRUE;<br />
	 AfxBeginThread(run,this);<br />
}


void CMina_sView::ascultarea()<br />
{<br />
	<br />
	CSerial serial;<br />
	LONG    lLastError = ERROR_SUCCESS;<br />
			DWORD dwBytesRead = 0 ;<br />
			char szBuffer[21];<br />
	CString str2="jjk";<br />
			char of[5]= "Addd";<br />
			int i=10;<br />
	const int nBuflen = sizeof(szBuffer)-1;<br />
			<br />
     lLastError = serial.Open(_T("COM1"),0,0,false);<br />
        lLastError = serial.Setup(CSerial::EBaud9600,CSerial::EData8,CSerial::EParNone,CSerial::EStop1);<br />
    lLastError = serial.SetMask(CSerial::EEventBreak |<br />
								CSerial::EEventCTS   |<br />
								CSerial::EEventDSR   |<br />
								CSerial::EEventError |<br />
								CSerial::EEventRing  |<br />
								CSerial::EEventRLSD  |<br />
								CSerial::EEventRecv);<br />
<br />
    lLastError = serial.SetupReadTimeouts(CSerial::EReadTimeoutNonblocking);<br />
<br />
		lLastError = serial.WaitEvent();<br />
<br />
		const CSerial::EEvent eEvent = serial.GetEventType();<br />
<br />
		if (eEvent & CSerial::EEventRecv)<br />
		{<br />
		while (running)<br />
		{Sleep(300);<br />
			dwBytesRead = 0;<br />
			<br />
<br />
			serial.Read(szBuffer,nBuflen,&dwBytesRead);<br />
			szBuffer[dwBytesRead] = '\0';<br />
			str2.TrimLeft();<br />
			str2.TrimRight();<br />
			str2.TrimLeft();<br />
			str2.TrimRight();<br />
// do smth with str2<br />
		}<br />
		}<br />
		//Sleep(0);<br />
		running = FALSE;<br />
    serial.Close();<br />
<br />
}<br />
<br />
UINT CMina_sView::run(LPVOID p)<br />
{<br />
     CMina_sView * me = (CMina_sView *)p;<br />
     me->ascultarea();<br />
     return 0;<br />
<br />
}


If I run the program I get an error. If I run it in debug mode I when try to watch str2 i get the error: "symbol "str2" not found" What's wrong? I can watch any other variable.
AnswerRe: Problem with CString! CXX0017 Pin
Cedric Moonen26-Jul-06 1:40
Cedric Moonen26-Jul-06 1:40 
GeneralRe: Problem with CString! CXX0017 Pin
tanarnelinistit26-Jul-06 1:52
tanarnelinistit26-Jul-06 1:52 
GeneralRe: Problem with CString! CXX0017 Pin
Cedric Moonen26-Jul-06 1:57
Cedric Moonen26-Jul-06 1:57 
GeneralRe: Problem with CString! CXX0017 Pin
tanarnelinistit26-Jul-06 2:04
tanarnelinistit26-Jul-06 2:04 
GeneralRe: Problem with CString! CXX0017 Pin
Cedric Moonen26-Jul-06 2:11
Cedric Moonen26-Jul-06 2:11 
GeneralRe: Problem with CString! CXX0017 Pin
tanarnelinistit26-Jul-06 2:20
tanarnelinistit26-Jul-06 2:20 
GeneralRe: Problem with CString! CXX0017 Pin
Christian Graus26-Jul-06 2:12
protectorChristian Graus26-Jul-06 2:12 
GeneralRe: Problem with CString! CXX0017 Pin
tanarnelinistit26-Jul-06 2:24
tanarnelinistit26-Jul-06 2:24 
GeneralRe: Problem with CString! CXX0017 Pin
Cedric Moonen26-Jul-06 2:42
Cedric Moonen26-Jul-06 2:42 
GeneralRe: Problem with CString! CXX0017 [modified] Pin
tanarnelinistit26-Jul-06 2:50
tanarnelinistit26-Jul-06 2:50 
GeneralRe: Problem with CString! CXX0017 Pin
David Crow26-Jul-06 2:54
David Crow26-Jul-06 2:54 
GeneralRe: Problem with CString! CXX0017 Pin
Cedric Moonen26-Jul-06 3:04
Cedric Moonen26-Jul-06 3:04 
QuestionRe: Problem with CString! CXX0017 Pin
David Crow26-Jul-06 2:52
David Crow26-Jul-06 2:52 
AnswerRe: Problem with CString! CXX0017 Pin
tanarnelinistit26-Jul-06 3:03
tanarnelinistit26-Jul-06 3:03 
GeneralRe: Problem with CString! CXX0017 Pin
David Crow26-Jul-06 3:10
David Crow26-Jul-06 3:10 
AnswerRe: Problem with CString! CXX0017 Pin
James R. Twine26-Jul-06 2:57
James R. Twine26-Jul-06 2:57 
GeneralRe: Problem with CString! CXX0017 Pin
tanarnelinistit26-Jul-06 3:04
tanarnelinistit26-Jul-06 3:04 

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.