|
-
November 30th, 2000, 09:44 AM
#1
ASSERT(pState->m_hSocketWindow != NULL)
I'm using CSockets. Somethimes when I'm using my application (simple POP3-SMTP mailer) I got a Debug Assertion Error in sockcore.cpp line 851...
This is PumpMessages function and line is...
ASSERT(pState->m_hSocketWindow != NULL);
Does anyone know where's the problem...
I think that beta MFC patch mfc42b isn't the solution...
-
November 30th, 2000, 10:12 AM
#2
Re: ASSERT(pState->m_hSocketWindow != NULL)
Can you be more specific? My crystal ball won't work today because of increased EM radiation.
Under what circumstances does this occur? On what kind of socket? Do you create sockets dynamically? Are sockets always associated with a valid window? Is the error reproducible, or does it appear to be non-deterministic?
Frankly, I don't believe it is an MFC bug. If it was, someone else would have probably stumbled upon it. Chances are that there is something in your code that makes it choke.
-n
-
January 28th, 2004, 07:50 AM
#3
Re: ASSERT(pState->m_hSocketWindow != NULL)
Originally posted by BBKhan
I'm using CSockets. Somethimes when I'm using my application (simple POP3-SMTP mailer) I got a Debug Assertion Error in sockcore.cpp line 851...
This is PumpMessages function and line is...
ASSERT(pState->m_hSocketWindow != NULL);
Does anyone know where's the problem...
I think that beta MFC patch mfc42b isn't the solution...
probably u r using CSocket inside some other thread. If u r doing it , it is not very simple. i expain if u confirm it.
but for just checking run ure program with static library and release mode.
-
March 26th, 2006, 11:01 PM
#4
Re: ASSERT(pState->m_hSocketWindow != NULL)
 Originally Posted by atif_ilm
probably u r using CSocket inside some other thread. If u r doing it , it is not very simple. i expain if u confirm it.
but for just checking run ure program with static library and release mode.
i m facing same problem ...and i m using some other thread in the CSocket.....would u tell me the solution?
-
March 27th, 2006, 04:21 AM
#5
Re: ASSERT(pState->m_hSocketWindow != NULL)
hmmmmm I faced this problem long time ago , but le me recollect it.
yeh do the following things.
1. If u r using VS6.0 install Visual Studio Service Pakc 6 or Higer.
2. In the main thread accept the new connection, this will
give u a new CSocket object. Detach the socket handle from this
socket. Start new thread in suspended mode. Then assign this
detached socket handle to some member varibale of thread object.
then Resume the thread. In the InitInstance of ure new thread attach
that sockt handle to some member variable socket. And use this new socket for further communication.
2nd Point is just to make the whole process more safer.
and the last advice dont use MFC sockets, MFC is bull **** stuff. Buggy and slow. Instead of it use WINSOCK API, those are quite fast and less buggy.
Unmanaged in a .NET world
-
March 27th, 2006, 11:57 AM
#6
Re: ASSERT(pState->m_hSocketWindow != NULL)
 Originally Posted by atif_ilm
and the last advice dont use MFC sockets, MFC is bull **** stuff. Buggy and slow. Instead of it use WINSOCK API, those are quite fast and less buggy.
I completely agree. Use Winsock API. It is very good IMHO.
Please don't forget to rate users who helped you!
-
March 28th, 2006, 04:05 AM
#7
Re: ASSERT(pState->m_hSocketWindow != NULL)
Thanks for your reply.
I am facing this problem in client side......would you tell me ur suggestion...
 Originally Posted by atif_ilm
hmmmmm I faced this problem long time ago , but le me recollect it.
yeh do the following things.
1. If u r using VS6.0 install Visual Studio Service Pakc 6 or Higer.
2. In the main thread accept the new connection, this will
give u a new CSocket object. Detach the socket handle from this
socket. Start new thread in suspended mode. Then assign this
detached socket handle to some member varibale of thread object.
then Resume the thread. In the InitInstance of ure new thread attach
that sockt handle to some member variable socket. And use this new socket for further communication.
2nd Point is just to make the whole process more safer.
and the last advice dont use MFC sockets, MFC is bull **** stuff. Buggy and slow. Instead of it use WINSOCK API, those are quite fast and less buggy.
-
March 30th, 2006, 04:51 AM
#8
Re: ASSERT(pState->m_hSocketWindow != NULL)
Install Visual Studio Service Pack 6 or Higer, if u have VS6.0 otherwise use Visual Studio .NET.
Unmanaged in a .NET world
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|