Click here to Skip to main content
15,929,721 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Insertion or removal of CD Pin
David Crow22-Mar-07 2:53
David Crow22-Mar-07 2:53 
QuestionAutorun for CD drive [modified] Pin
VC_RYK19-Mar-07 19:00
VC_RYK19-Mar-07 19:00 
AnswerRe: Autorun for CD drive Pin
toxcct19-Mar-07 20:42
toxcct19-Mar-07 20:42 
AnswerRe: Autorun for CD drive Pin
Rajesh R Subramanian19-Mar-07 22:54
professionalRajesh R Subramanian19-Mar-07 22:54 
Questiondefault icon for file type Pin
ppp00119-Mar-07 18:48
ppp00119-Mar-07 18:48 
AnswerRe: default icon for file type Pin
Paresh Chitte19-Mar-07 19:12
Paresh Chitte19-Mar-07 19:12 
QuestionViewing a ppm file Pin
softwareSurfer19-Mar-07 18:47
softwareSurfer19-Mar-07 18:47 
QuestionCAsyncSocket::OnReceive never called Pin
csmithmaui19-Mar-07 18:26
csmithmaui19-Mar-07 18:26 
Hi,
I am having a problem getting the OnReceive notification to trigger in my client code. I debugged with TRACE statements and I find that the Receive is failing with the WSAEWOULDBLOCK error and then OnReceive is never being called. I should have data being delivered to the client but I can't say 100% that this is true. I didn't write the server code but it has been used before and is know to work.

//Next three lines are performed in a separate in a function that gets called from OnInitDlg()
m_pDASsocket = new CSPDSSSocket;
m_pDASsocket->Create(0,SOCK_STREAM, FD_READ | FD_CONNECT | FD_WRITE);
m_pDASsocket->m_pMain = (CMyGUIDlg*)this;



void CMyGUIDlg::OnBnClickedmfp()
{
	PBYTE pBuf;
	pBuf = new BYTE[8];
	//FILE * file;
	char startrecvchar = 100;

	if(m_bSocketConnected)
	{   
		m_pDASsocket->Send(&startrecvchar,1);

		// psuedo code
		if ( m_pDASsocket->Receive(pBuf,8) == SOCKET_ERROR )
		{
		  int iErr = WSAGetLastError();
		  if ( iErr == WSAEWOULDBLOCK )
		  {
			TRACE("OnBnClickedmfp: WSAEWOULDBLOCK");
		  }
		  else
		  {
			  TRACE("OnBnClickedmfp: a ""bad"" error occurred and must be handled");
		  }
		}
		else
		{
			TRACE("OnBnClickedmfp: Receive succeeded");
		}
	}


			
	delete [] pBuf;


}



I know that OnConnect and OnSend are getting called. I also know the server is receiving my Send. As far as I know the server is working correctly. I don't have any control over the server code but I know it's listening for connections and once connected I can send certain commands to start and stop data packet delivery. Any help would be greatly appreciated! Thanks,

Clint

csmithmaui

"Turn My Headphones Up!"

AnswerRe: CAsyncSocket::OnReceive never called Pin
Mark Salsbery20-Mar-07 9:57
Mark Salsbery20-Mar-07 9:57 
QuestionTab control Pin
janpoo19-Mar-07 18:22
janpoo19-Mar-07 18:22 
AnswerRe: Tab control Pin
cp987619-Mar-07 20:22
cp987619-Mar-07 20:22 
Questionflickering problem when resize the application. Pin
amitmistry_petlad 19-Mar-07 17:54
amitmistry_petlad 19-Mar-07 17:54 
AnswerRe: flickering problem when resize the application. Pin
prasad_som19-Mar-07 18:22
prasad_som19-Mar-07 18:22 
GeneralRe: flickering problem when resize the application. Pin
amitmistry_petlad 19-Mar-07 18:42
amitmistry_petlad 19-Mar-07 18:42 
GeneralRe: flickering problem when resize the application. Pin
prasad_som19-Mar-07 19:07
prasad_som19-Mar-07 19:07 
QuestionHow can I edit bitmap Image? Pin
Md. Mazharul Islam Khan19-Mar-07 17:31
Md. Mazharul Islam Khan19-Mar-07 17:31 
AnswerRe: How can I edit bitmap Image? Pin
Hamid_RT20-Mar-07 3:08
Hamid_RT20-Mar-07 3:08 
QuestionSHBrowseForFolder not working in wince 5.0(x86) processor Pin
joemittu19-Mar-07 17:12
joemittu19-Mar-07 17:12 
Questionsome problems about listbox control Pin
Chen-XuNuo19-Mar-07 16:41
Chen-XuNuo19-Mar-07 16:41 
AnswerRe: some problems about listbox control Pin
Chen-XuNuo19-Mar-07 16:46
Chen-XuNuo19-Mar-07 16:46 
AnswerRe: some problems about listbox control Pin
prasad_som19-Mar-07 18:29
prasad_som19-Mar-07 18:29 
GeneralRe: some problems about listbox control Pin
Chen-XuNuo19-Mar-07 20:31
Chen-XuNuo19-Mar-07 20:31 
AnswerRe: some problems about listbox control Pin
prasad_som19-Mar-07 20:51
prasad_som19-Mar-07 20:51 
GeneralRe: some problems about listbox control Pin
Chen-XuNuo20-Mar-07 2:16
Chen-XuNuo20-Mar-07 2:16 
AnswerRe: some problems about listbox control Pin
prasad_som20-Mar-07 2:21
prasad_som20-Mar-07 2:21 

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.