Click here to Skip to main content
15,914,820 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Design Question Pin
Perspx5-Sep-08 10:17
Perspx5-Sep-08 10:17 
GeneralRe: Design Question Pin
hhh5-Sep-08 22:44
hhh5-Sep-08 22:44 
AnswerRe: Design Question Pin
john john mackey5-Sep-08 12:16
john john mackey5-Sep-08 12:16 
GeneralRe: Design Question Pin
hhh5-Sep-08 22:59
hhh5-Sep-08 22:59 
QuestionString literal expansion Pin
Jim Crafton5-Sep-08 7:44
Jim Crafton5-Sep-08 7:44 
AnswerRe: String literal expansion Pin
Michael Dunn5-Sep-08 8:07
sitebuilderMichael Dunn5-Sep-08 8:07 
AnswerRe: String literal expansion Pin
Garth J Lancaster5-Sep-08 15:00
professionalGarth J Lancaster5-Sep-08 15:00 
Questionhow to read data from com port Pin
manju23reddy5-Sep-08 7:40
manju23reddy5-Sep-08 7:40 
i have a program to connect the system with mobile via bluetooth serial connection and when it comes to read method it just stops.

and the read methos is
<br />
bool ReadPort()<br />
{<br />
     long int dwSize = 0;<br />
     bool hResult = false;<br />
     std::string sb = "";<br />
     DWORD dwEventMask;<br />
<br />
     if(!SetCommMask(hComm, EV_RXCHAR)) /* Setting Event Type */<br />
	 {	<br />
        return hResult;<br />
     }<br />
<br />
	if(WaitCommEvent(hComm, &dwEventMask, NULL)) /* Waiting For Event to Occur */<br />
	{<br />
		char szBuf[1024];<br />
		DWORD dwIncommingReadSize;<br />
<br />
		do<br />
		{<br />
			if(ReadFile(hComm, &szBuf, 1024, &dwIncommingReadSize, NULL) != 0)<br />
			{<br />
				if(dwIncommingReadSize > 0)<br />
				{<br />
					dwSize += dwIncommingReadSize;<br />
				    sb.append(szBuf);<br />
				}<br />
				hResult = true;<br />
			}<br />
<br />
			else<br />
			{<br />
				unsigned long error = ::GetLastError();<br />
				hResult = false;<br />
				printf("the error while reading error is %dl\n", error);<br />
				break;<br />
			}<br />
		} while(dwIncommingReadSize > 0);<br />
<br />
		*readData = new char[dwSize];<br />
		strcpy(*readData, sb.c_str());<br />
		return hResult;<br />
	}<br />
    else<br />
    {<br />
		return hResult;<br />
    }<br />
<br />
}<br />

the program just goes to wait mode in the WaitCommEvent function, even when i send a file via bluetooth from my mobile it does'nt reads and while iam sending the file the bluetooth pops the message that PIM transfer is happining, how to send file serial so that my read function should read the data and store in a file......
QuestionVC++ and CRystalReport Pin
kasi145-Sep-08 7:39
kasi145-Sep-08 7:39 
AnswerRe: VC++ and CRystalReport Pin
liquid_6-Sep-08 10:48
liquid_6-Sep-08 10:48 
QuestionThreads Pin
bhanu_85095-Sep-08 3:35
bhanu_85095-Sep-08 3:35 
AnswerRe: Threads Pin
David Crow5-Sep-08 3:53
David Crow5-Sep-08 3:53 
AnswerRe: Threads Pin
JudyL_MD5-Sep-08 4:38
JudyL_MD5-Sep-08 4:38 
GeneralRe: Threads Pin
bhanu_85096-Sep-08 0:12
bhanu_85096-Sep-08 0:12 
GeneralRe: Threads Pin
JudyL_MD6-Sep-08 2:46
JudyL_MD6-Sep-08 2:46 
AnswerRe: Threads Pin
Roger Stoltz5-Sep-08 4:42
Roger Stoltz5-Sep-08 4:42 
QuestionHow can Extract String ? Pin
Le@rner5-Sep-08 2:54
Le@rner5-Sep-08 2:54 
AnswerRe: How can Extract String ? Pin
_AnsHUMAN_ 5-Sep-08 2:57
_AnsHUMAN_ 5-Sep-08 2:57 
GeneralRe: How can Extract String ? Pin
toxcct5-Sep-08 3:07
toxcct5-Sep-08 3:07 
GeneralRe: How can Extract String ? Pin
_AnsHUMAN_ 5-Sep-08 3:20
_AnsHUMAN_ 5-Sep-08 3:20 
GeneralRe: How can Extract String ? Pin
toxcct5-Sep-08 3:37
toxcct5-Sep-08 3:37 
AnswerRe: How can Extract String ? Pin
Michael Dunn5-Sep-08 8:24
sitebuilderMichael Dunn5-Sep-08 8:24 
GeneralRe: How can Extract String ? Pin
Jerry Jeremiah7-Sep-08 11:21
Jerry Jeremiah7-Sep-08 11:21 
Questionuuid operator Pin
George_George5-Sep-08 2:15
George_George5-Sep-08 2:15 
AnswerRe: uuid operator Pin
_AnsHUMAN_ 5-Sep-08 2:56
_AnsHUMAN_ 5-Sep-08 2:56 

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.