Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
W

Will Beattie

@Will Beattie
About
Posts
7
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Rebuild VC++ Debug Library ?
    W Will Beattie

    Hi Ryan, Yes I tried their fix .. no luck. My code works as required in Release but Asserts when in Debug mode. As to MFC Sockets and multithreading the jury is undecided. This article has a section near the bottom called "CSocket Objects and Multithreading". http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnarpic/html/msdn\_wsockets.asp Thanks Will

    C / C++ / MFC c++ help com debugging question

  • Rebuild VC++ Debug Library ?
    W Will Beattie

    Thanks Ryan, I have done heap of hunting on this problem which basically boiled down to creating a Socket in one thread and then trying to use it in another thread. MFC does not allow sockets to be passed between threads or so it appears. I don't know if this is a bug as suggested by their bug fix "Q193101" "SYMPTOMS When using MFC sockets in secondary threads in a statically linked MFC Visual C++ 6.0 application, an unhandled exception occurs. CAUSE The reason for the unhandled exception is that an object of type CMapPtrToPtr pointer, pointed to by m_pmapSocketHandle, is never created." I will keep trying. cheers Will Beattie

    C / C++ / MFC c++ help com debugging question

  • Rebuild VC++ Debug Library ?
    W Will Beattie

    Hi all, I have a problem with an acknowledged MSDN Bug - being... using sockets in a multithread program. SP5 supposedly fixed the bug (?) but I still get asserts when using either version of the VC++ Debug libraries. Is there new Debug libraries available or can I just modify the sockcore.cpp file and rebuild it ? cheers Will Beattie whybotha69@hotmail.com

    C / C++ / MFC c++ help com debugging question

  • Getting IP and Language
    W Will Beattie

    Here is a code snippet that may be called more than once. The first time will return how many NET I/O addresses are available, a second call may nominate which of the available IP addresses to return. Hope this helps... cheers WillB //***************************************************************** //** ** //** ** //** ** //** G E T H O S T N A M E ** //** ** //** ** //** ** //***************************************************************** int MNF_GetHostIPAddress( CString & rszHostName, CString &rszHostIPAddress, int nIPSelection) { int nIPCount = 0; in_addr **papIPAddressList; HOSTENT *ptHostEnt = NULL; rszHostIPAddress = ""; // ---> ----------------------- <--- // ---> Discover IP address(es) <--- // ---> ----------------------- <--- ptHostEnt = gethostbyname( rszHostName ); if ( ptHostEnt != NULL ) { papIPAddressList = (in_addr **)&ptHostEnt->h_addr_list[ 0 ]; // ---> ----------------------- <--- // ---> Count the IP Addressess <--- // ---> ----------------------- <--- while ( papIPAddressList[ nIPCount ] != NULL ) { nIPCount++; } if ( nIPSelection < nIPCount ) { rszHostIPAddress = inet_ntoa( *papIPAddressList[ IPSelection ] ); } } return nIPCount; }

    C / C++ / MFC help

  • Unhandled Exception Using MFC Sockets in Visual C++ 6.0
    W Will Beattie

    Thanks Ryans, File: sockcore.cpp Line: 567 It was in the original post (I stepped through the code) and the problem appears to be in ...\SOCKCORE.CPP starting at line 563 (the Line: 567 CAsyncSocket::FromHandle(...) part). #ifdef _DEBUG void CAsyncSocket::AssertValid() const { CObject::AssertValid(); ASSERT(m_hSocket == INVALID_SOCKET || CAsyncSocket::FromHandle(m_hSocket) != NULL); } Any news may be good news !! I am happy to send the Client and the server projects to anyone who may be able to assist!! cheers Will Beattie

    C / C++ / MFC c++ help announcement com debugging

  • Unhandled Exception Using MFC Sockets in Visual C++ 6.0
    W Will Beattie

    Thanks for the comment, but I did all that and found the (mentioned) MSDN article. It was after exhausting all these avenues that I turned here !!

    C / C++ / MFC c++ help announcement com debugging

  • Unhandled Exception Using MFC Sockets in Visual C++ 6.0
    W Will Beattie

    I am running VC++ Vn 6.0 SP5 and am writing a program using multiple threads with CSockets. I am having problems i.e. Popup Dialog with: Microsoft Visual C++ Debug Library Debug Assertion Failed! File: sockcore.cpp Line: 567 This type of problem is documented on MSDN in an article "Q193101" acknowledging a bug in the static library. MSDN SP5 has a fix(?) for this and suggests adding "AfxSockInit()" to each each thread that uses sockets. I have done this and I am not getting assertions in the Release exe but I am still getting them in the debug version. Do I need new debug libraries, or should I just ignore the assertions - this is a "pita". suggestions welcome whybotha69@hotmail.com // the last C bug if (missilesDetected()); LaunchCounterAttack();

    C / C++ / MFC c++ help announcement com debugging
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups