Click here to Skip to main content
16,008,750 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Inheritance and CFormView Pin
Joaquín M López Muñoz15-Apr-02 9:52
Joaquín M López Muñoz15-Apr-02 9:52 
GeneralRe: Inheritance and CFormView Pin
dazinith15-Apr-02 11:00
dazinith15-Apr-02 11:00 
Generalstring to LPCWSTR Pin
15-Apr-02 9:30
suss15-Apr-02 9:30 
GeneralRe: string to LPCWSTR Pin
Tim Smith15-Apr-02 9:44
Tim Smith15-Apr-02 9:44 
GeneralRe: string to LPCWSTR Pin
Joaquín M López Muñoz15-Apr-02 10:33
Joaquín M López Muñoz15-Apr-02 10:33 
Generalproblem creating a window just like debugger window in VC++ Pin
Arunkb15-Apr-02 8:46
Arunkb15-Apr-02 8:46 
GeneralRe: problem creating a window just like debugger window in VC++ Pin
l a u r e n15-Apr-02 9:51
l a u r e n15-Apr-02 9:51 
GeneralProblems with CSocket Pin
Sprudling15-Apr-02 8:08
Sprudling15-Apr-02 8:08 
I'm trying to create a simple IRC client for learning purposes. I made it singlethreaded to begin with and everything worked great. But after I added a thread to handle incoming messages from the IRC server i keep getting an assertion when there isn't anything to recieve. I've traced it down to this...

while ((nResult = CAsyncSocket::Receive(lpBuf, nBufLen, nFlags)) == SOCKET_ERROR)
{
	if (GetLastError() == WSAEWOULDBLOCK)
	{
		if (!PumpMessages(FD_READ))
			return SOCKET_ERROR;
.
.
.
This code above is taken from within the function (CSocket::Receive) I call to recieve data from the IRC server, and as long as there is data to recieve CAsyncSocket::Receive returns the number of bytes read and everything is ok. But when there isn't GetLastError() returns WSAEWOULDBLOCK and CSocket::PumpMessages is beeing called...:

ASSERT(m_pbBlocking == NULL);
_AFX_SOCK_THREAD_STATE* pState = _afxSockThreadState;
ASSERT(pState->m_hSocketWindow != NULL);
The above code is the beginning of CSocket::PumpMessages, and this last assertion is the one I'm talking about. Why is PumpMessages called at all? I just want Recieve to return whatever data is waiting to be recieved, and if there is none just wait for some Smile | :)

Sprudling Confused | :confused:

PS! I created the new thread using ::CreateThread(), not using the CWinThread MFC class. Could that have anything to do with it?
GeneralRe: Problems with CSocket Pin
Paul A. Howes15-Apr-02 9:33
Paul A. Howes15-Apr-02 9:33 
GeneralRe: Problems with CSocket Pin
Sprudling15-Apr-02 10:13
Sprudling15-Apr-02 10:13 
GeneralRe: Problems with CSocket Pin
Paul A. Howes15-Apr-02 12:14
Paul A. Howes15-Apr-02 12:14 
QuestionHow to Execute a continues Dos command from C++ Pin
Gaurika Wijeratne15-Apr-02 7:59
Gaurika Wijeratne15-Apr-02 7:59 
AnswerRe: How to Execute a continues Dos command from C++ Pin
Nish Nishant15-Apr-02 8:08
sitebuilderNish Nishant15-Apr-02 8:08 
AnswerRe: How to Execute a continues Dos command from C++ Pin
Ben Burnett15-Apr-02 10:04
Ben Burnett15-Apr-02 10:04 
GeneralBUG Pin
Gianfranco Lanzetta15-Apr-02 7:03
Gianfranco Lanzetta15-Apr-02 7:03 
GeneralRe: BUG Pin
Tim Smith15-Apr-02 7:20
Tim Smith15-Apr-02 7:20 
GeneralRe: BUG Pin
Nish Nishant15-Apr-02 7:27
sitebuilderNish Nishant15-Apr-02 7:27 
GeneralRe: BUG Pin
Tim Smith15-Apr-02 8:01
Tim Smith15-Apr-02 8:01 
GeneralRe: BUG Pin
Nish Nishant15-Apr-02 8:06
sitebuilderNish Nishant15-Apr-02 8:06 
GeneralRe: BUG Pin
Tim Smith15-Apr-02 8:10
Tim Smith15-Apr-02 8:10 
GeneralRe: BUG Pin
Gianfranco Lanzetta15-Apr-02 7:44
Gianfranco Lanzetta15-Apr-02 7:44 
GeneralRe: BUG Pin
Tim Smith15-Apr-02 8:01
Tim Smith15-Apr-02 8:01 
GeneralRe: BUG Pin
Tim Smith15-Apr-02 8:09
Tim Smith15-Apr-02 8:09 
QuestionHow to get handle of control ? Pin
dlhson15-Apr-02 6:29
dlhson15-Apr-02 6:29 
AnswerRe: How to get handle of control ? Pin
Nish Nishant15-Apr-02 6:39
sitebuilderNish Nishant15-Apr-02 6:39 

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.