Debug assertion failed trying to CAsyncSocket::Connect()

Hi,

I have a client (locally) trying to connect to a server locally.
If i connect (using CAsyncSocket::Connect()) with the IP that IPconfig
gives, i get a debug assertion failed. After pressing the RETRY button
on the debug assertion failed dialog the source goes to :

 /*
         * If this ASSERT fails, a bad pointer has been passed in. It
may be
         * totally bogus, or it may have been allocated from another
heap.
         * The pointer MUST come from the 'local' heap.
         */
        _ASSERTE(_CrtIsValidHeapPointer(pUserData));

in dbgheap.cpp

If i connect on 127.0.0.1 everything goes ok.

Why cant i use my own assigned 82.75.181.131 as IP to connect to ?

0
nijenhuis (92)
8/13/2007 8:14:17 PM
vc.mfc 33608 articles. 0 followers. Follow

4 Replies
321 Views

Similar Articles

[PageSpeed] 23

On Aug 13, 10:14 pm, RAN <nijenh...@wish.nl> wrote:
> Hi,
>
> I have a client (locally) trying to connect to a server locally.
> If i connect (using CAsyncSocket::Connect()) with the IP that IPconfig
> gives, i get a debug assertion failed. After pressing the RETRY button
> on the debug assertion failed dialog the source goes to :
>
>  /*
>          * If this ASSERT fails, a bad pointer has been passed in. It
> may be
>          * totally bogus, or it may have been allocated from another
> heap.
>          * The pointer MUST come from the 'local' heap.
>          */
>         _ASSERTE(_CrtIsValidHeapPointer(pUserData));
>
> in dbgheap.cpp
>
> If i connect on 127.0.0.1 everything goes ok.
>
> Why cant i use my own assigned 82.75.181.131 as IP to connect to ?

Oops newbie error i was trying to copy the string from GetPeerName()
into a char s_Buffer[12], which is to small. 127.0.0.1 does fit a 12
size s_Buffer, my mistake... How do you delete a question from the
newsgroup anyway??

0
nijenhuis (92)
8/13/2007 8:21:28 PM
When you press Retry, take a look at the call stack, trace the calls back to 
something you know.  Then see if you can find the source of the problem.

AliR.


"RAN" <nijenhuis@wish.nl> wrote in message 
news:1187036057.683749.212440@19g2000hsx.googlegroups.com...
> Hi,
>
> I have a client (locally) trying to connect to a server locally.
> If i connect (using CAsyncSocket::Connect()) with the IP that IPconfig
> gives, i get a debug assertion failed. After pressing the RETRY button
> on the debug assertion failed dialog the source goes to :
>
> /*
>         * If this ASSERT fails, a bad pointer has been passed in. It
> may be
>         * totally bogus, or it may have been allocated from another
> heap.
>         * The pointer MUST come from the 'local' heap.
>         */
>        _ASSERTE(_CrtIsValidHeapPointer(pUserData));
>
> in dbgheap.cpp
>
> If i connect on 127.0.0.1 everything goes ok.
>
> Why cant i use my own assigned 82.75.181.131 as IP to connect to ?
> 


0
AliR3470 (3235)
8/13/2007 8:21:55 PM
Not sure if this works
http://kb.iu.edu/data/aewv.html

P.S. Try using CString instead of C style strings.  It will save your life 
one day.

AliR.

"RAN" <nijenhuis@wish.nl> wrote in message 
news:1187036488.359756.199420@r34g2000hsd.googlegroups.com...
> On Aug 13, 10:14 pm, RAN <nijenh...@wish.nl> wrote:
>> Hi,
>>
>> I have a client (locally) trying to connect to a server locally.
>> If i connect (using CAsyncSocket::Connect()) with the IP that IPconfig
>> gives, i get a debug assertion failed. After pressing the RETRY button
>> on the debug assertion failed dialog the source goes to :
>>
>>  /*
>>          * If this ASSERT fails, a bad pointer has been passed in. It
>> may be
>>          * totally bogus, or it may have been allocated from another
>> heap.
>>          * The pointer MUST come from the 'local' heap.
>>          */
>>         _ASSERTE(_CrtIsValidHeapPointer(pUserData));
>>
>> in dbgheap.cpp
>>
>> If i connect on 127.0.0.1 everything goes ok.
>>
>> Why cant i use my own assigned 82.75.181.131 as IP to connect to ?
>
> Oops newbie error i was trying to copy the string from GetPeerName()
> into a char s_Buffer[12], which is to small. 127.0.0.1 does fit a 12
> size s_Buffer, my mistake... How do you delete a question from the
> newsgroup anyway??
> 


0
AliR3470 (3235)
8/13/2007 8:24:52 PM
Also, try to avoid 'char' as a data type, since you have no idea if your app might have to
be recompiled in Unicode someday.  And you should typically avoid any fixed-size array of
characters anyway; and if you feel you must, forget that you ever heard of strcpy or
strcat.   They are dead, dead, dead and should never be used for serious programming.  In
VS6, you can use StringCchCopy or StringCchCat, which will not cause buffer overruns; in
VS2005 you can use strcpy_s and strcat_s.  Also, never use sprintf for any reason; use
StringCchPrintf or sprintf_s.
					joe

On Mon, 13 Aug 2007 20:24:52 GMT, "AliR \(VC++ MVP\)" <AliR@online.nospam> wrote:

>Not sure if this works
>http://kb.iu.edu/data/aewv.html
>
>P.S. Try using CString instead of C style strings.  It will save your life 
>one day.
>
>AliR.
>
>"RAN" <nijenhuis@wish.nl> wrote in message 
>news:1187036488.359756.199420@r34g2000hsd.googlegroups.com...
>> On Aug 13, 10:14 pm, RAN <nijenh...@wish.nl> wrote:
>>> Hi,
>>>
>>> I have a client (locally) trying to connect to a server locally.
>>> If i connect (using CAsyncSocket::Connect()) with the IP that IPconfig
>>> gives, i get a debug assertion failed. After pressing the RETRY button
>>> on the debug assertion failed dialog the source goes to :
>>>
>>>  /*
>>>          * If this ASSERT fails, a bad pointer has been passed in. It
>>> may be
>>>          * totally bogus, or it may have been allocated from another
>>> heap.
>>>          * The pointer MUST come from the 'local' heap.
>>>          */
>>>         _ASSERTE(_CrtIsValidHeapPointer(pUserData));
>>>
>>> in dbgheap.cpp
>>>
>>> If i connect on 127.0.0.1 everything goes ok.
>>>
>>> Why cant i use my own assigned 82.75.181.131 as IP to connect to ?
>>
>> Oops newbie error i was trying to copy the string from GetPeerName()
>> into a char s_Buffer[12], which is to small. 127.0.0.1 does fit a 12
>> size s_Buffer, my mistake... How do you delete a question from the
>> newsgroup anyway??
>> 
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
8/20/2007 6:29:52 AM
Reply:

Similar Artilces:

3.0 Upgrade Failed
We have recently been trying to upgrade our 1.2 installation to 3.0, but have ran into some stumbling blocks along the way. After resolving the "Invalid SQL replication data" error on the advisor we were finally able to continue on with the installation but now continuously get the below error causing a failed installation. The enviornment is as such: SQL 2000 SP4 on 2003 std CRM 1.2 on seperate 2003 std Active Directory operating in 2003 functional Any thoughts or suggestions are welcome. Thanks! Error| Install exception.System.Exception: Action Microsoft.Crm.Setup.Server....

Update Fails to Load
I have tried several times to install KB979683 and keep getting failure message. All other updates load fine. Also, have Stopzilla and McAfee Virus Scan but can't seem to get rid of a malicious file that won't let me go to sites when I look up things on google, bing....always get sent to advertisement websites. Any ideas or helpful suggestions!! Thanks Always state your full Windows version (e.g., WinXP SP3; WinXP 64-bit SP2; Vista SP1; Vista 64-bit SP2; Win7; Win7 64-bit) when posting in a forum or newsgroup. Please do so in your next reply. When does your McAfee su...

Outlook Connection Status...
I've found numerous sources on the Internet telling me how to view the Outlook/Exchange Server Connection Status window (CTRL+Right-Click), but nothing gives a detailed description of what it all means. I get the server name, type, etc. What about Avg Resp? is that in milliseconds or what? What are acceptable ranges? What about Req/Fail? What are acceptable ranges for requests? What could cause failures (network, Exchange services down, etc)? In news:80ED7613-46FA-429C-9A60-A85FD70E0158@microsoft.com, SilverICE <SilverICE@discussions.microsoft.com> typed: > I'v...

Mac Can't Connect to Exchange Server
Our office recently upgraded to Exchange Server 2003. Among the many problems that have resulted, I can no longer connect with my Mac Powerbook G4. I can create a VPN tunnel but I can't ping the server, although the sever can ping me. (Oddly, the IP address I get is not the same as the IP address that the server believes I'm on.) I also cannot connect to the server (i.e., GO > Connect to Server). When I try, I get a message that my user name and password are no good, which is not the case. In addition, I cannot browse the server using MISE or connect to the exchange server using Ent...

The Operation on the | Object failed
I have an access database linked to a SQL server 2005 back end database and my users randomly get the above message on occasions. It appears to usually happen when running VBA code. Can anybody help? ...

Dialog and asserts
Hi, I have a dialog based application and I want to open another dialog. I have a function int CMyDialog::Execute { // CMyDialog::Execute int ret_code; CNewDialog m_NewDialog(this); ret_code = m_NewDialog.DoModal(); return ret_code; } // CMyDialog::Execute that opens this dialog but this fail :( I got at assert on this line BOOL CWnd::Attach(HWND hWndNew) { ---> ASSERT(m_hWnd == NULL); // only attach once, detach on I have realized my application with the Wizard so I am not very expert about this stuff. Can someone tell me what's happening ? Stefano Malavasi __...

Debug Assertion Faild
Debug Assertion Fail Program: C:..... File: winocc.cp Line: 22 The exception Breakpoin A breakpoint has been reache (0x80000003) occurred in the application at location 0x5f4369c This program is to scan a file and look for a matching string. Could this error be caused by code not exiting a "break;" properly? I'm not sure how to explore resolving this. The information listed in the Debug is The thread 0x3DD8 has exited with code 0 (0x0) The thread 0x3EA8 has exited with code -2147483645 (0x80000003) The program 'C:\Documents and Settings\Owner\My Documents\Dads\Programmi...

ERROR when trying to Uninstall Exchange
I'm in a huge bind. I have 2 Exchange 2003 Front End servers and 6 Exchange 2000 servers that I need to remove (They're being replaced). When I put in the Exchange CD and try to uninstall I get the following error: "No Object Found" This happens on the 2000 and 2003 servers. (I am using the appropriate disk). I really need to get these servers out. They've been marked for "Parts" to be used for other servers that are dying. Thanks Ron At what stage of the uninstall process do you get this ? Do you get this on every Exchange server you try and uninstal...

How to reinstall failed updates in Windows 7
How do i try to reinstall failed updates ? Seems windows update doesn't support that. I have Windows 7. Suggest you post this to the Windows 7 forum instead of the * Windows Update * newsgroup: http://social.answers.microsoft.com/Forums/en-US/w7install/threads "JamesW" wrote: > How do i try to reinstall failed updates ? > > Seems windows update doesn't support that. > > I have Windows 7. Ditto - another Win7 user here - when I follow recommendation to troubleshoot on the error code "WindowsUpdate_8020000E" appears as non...

When the VBA Project is locked the Save As Method fails in Excel
I cannot find a resolution. I already have the VB Code secure (the VBA Project is locked). When the Project is locked the Save As Method fails. If the VBA Project is not locked, the Save As Method works successfully. I cannot seem to find anything that addresses that situation. Do I need to get a digital signature? Do you think that will fix the problem? ...

Sound/Speaker Connections?
A friend is trying to setup speakers on a computer he was given and has not been able to get any sound from it. I believe there are (at least) two types of speaker system, one type requires a power source to power the speakers and another (probably older) does not? - Can anyone tell me what these two systems are called? (I believe there called Wired and Unwired) or something like that)? - How does one determine what speaker system will work on your computer? (I believe the newer computer use speakers driven by a power source)? On Mar 31, 6:20=A0am, "Artreid" <art...

OWA Fails to Load
Two OWA environments are failing with the same behavior. 1) The first environment is Windows NT 4 SP6a running Exchange 5.5 SP4. OWA is hosted on seperate NT box running IIS. IIS box must be restarted to temporarilly solve problem. Works for a day or so then main OWA page fails to talk to Exchange box after login and simply hangs with no erors, or gives an ASP error, but nothing in eventlogs. Cannot restart WWW service on IIS box. 2) Second environment is Windows 2000 SP4 running Exchange 5.5 SP4 and IIS on the same box. Same behavior as first environment. OWA hangs after login and does...

DEBUG
Curious, new problem has started. Evey once in a whle a new folder appears on my desktop labeled "debug"..The folder is empty and I do not know how it is formed or why..Does someone know the cause of this and a remedy so it does not appear again Thanks Running Xp professtional heshie wrote: > Curious, new problem has started. Evey once in a whle a new folder appears on > my desktop labeled "debug"..The folder is empty and I do not know how it is > formed or why..Does someone know the cause of this and a remedy so it does > not appear again &g...

An application crashes only under debugging
Hi, I'm using VC++ 6.0. I have a Win32 Application (I will call it "EXE") which is linked with a Win32 DLL and I don't have the source files of the DLL; When I execute the EXE by double-clicking on the icon reprsenting it , there are no problems; On the contrary, if I try to debug the EXE the program crashes: in fact, the debugger shows an "Access Violation" error message and informs that an istruction of the DLL attempts to read a memory location which cannot be read. Does someone know a possible cause of this problem? Thanks. M If the DLL is an MFC DLL (it is...

error trying to export messages from Outlook Express 6
I have a new computer and am trying to move my account and messages from the old computer to the new one. I was able to export/import account settings, but have not been able to move the messages I have stored. I tried to use Export Messages, but received the following error message: --The export could not be performed. --An error occurred while initializing MAPI. Any ideas? Cannot seem to find anything about this in the Knowledge Base. This newsgroup is for support of Outlook 97-2003 from the Office family for Windows PCs. For Outlook Express (OE) support try posting in one of these new...

Portfolio Manger Fails
I see where others have a similar problem, but have read no solution. After "upgrading" from Money2004 to Money2005, the portfolio manager pages shows a blank screen. No investment information whatsoever. Any ideas on a work around.... In microsoft.public.money, brawn wrote: >I see where others have a similar problem, but have read no solution. After >"upgrading" from Money2004 to Money2005, the portfolio manager pages shows a >blank screen. No investment information whatsoever. Any ideas on a work >around.... Does Help->About show version 14.0...

Excel 2007 data connection
I've set up a connection to an Access DB to pull data over for my worksheet. Once the connection is made, and the data is over, I can no longer open the file if I'm not connected to the network. Is there some setting that I'm just not seeing where I have to set it to cache the results? Please ignore this question. I've figured out why I couldn't open the file like I wanted to. ...

Authentication failed because Entourage doesn't support any of the available authentication methods. 04-13-10
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel Email Client: pop Out of a sudden, i can't send out email and received the above error message. <br><br>For incoming email, i've no problem receiving. <br><br>I've not done any changes in my email account setting. <br><br>Anyone encountered the same problem? Please assist and advice. <br><br>Thanks ...

configuring Exchange to accept SMTP connections
hi folks, We have one Exchange 2003 server which is behind our firewall. This relays to a sendmail SMTP server located in the DMZ. How can I configure Exchange to only make connections (and rejecting all other SMTP connections) to this sendmail smtp server, thus securing it ? Thanks, chrism. I guess you have just opened up the SMTP port on the firewall... allowing any traffic on that port to pass through? A better way would be actually put a rule on the firewall that specifies to only allow SMTP traffic to the sendmail machine's IP. The exact procedure to do this would depend on...

Weird: CRichEditCtrl scrollbars work in debug build but not in release build
Hi, I have an App Wizard project (VS 6.0), non doc-view architecture. My view class is: class CRichTextView : public CRichEditCtrl. In MainFrm.cpp I have a member variable of: CRichTextView m_wndView;. I create the view as follows: if (!m_wndView.Create(WS_CHILD | WS_VISIBLE | ES_AUTOVSCROLL | ES_MULTILINE | WS_VSCROLL, CRect(0,0,0,0), this, AFX_IDW_PANE_FIRST)) { TRACE0("Failed to create view window\n"); return -1; } It works "just peachy" in the debug build. But, when I make...

Problems Connecting Outlook To Exchange Server
Hi. Our site has recently upgraded to using Office 2003 on Windows XP and we connect to Exchange 2003. I have run into a couple of instances where the Outlook client will not connect to the Exchange server and Outlook reports "Your Exchange server is unavailable". This problem appears to be profile related and not a DNS error. Until recently, all of the users at my site were using peer-to-peer networking. A few weeks ago, we started upgrading people to the domain model. The Exchange connectivity problem occurs with people who have not yet moved into the domain and are trying to...

trying to create an email in outlook
i am desparately needing help - I am not very good when it comes to computers....i am trying to create an email, however i can not type anything in the body of the email - it was coming up saying the document was locked. Now i cant even get a new email page on the screen. The options are not bold. (just light grey - so i cant choose it) I hope this may make some sense to someone What version of Outlook are you using? Also, do you know if you're using Word as your email editor? You can check that on the Tools menu > Options > Mail Format tab "computer illiterate" &l...

SFO connection question
On SFO I am connected to a MSCRM server 1. Now I want to connect to another server. Where do I have to specify the server ? Or is it only at the client installation time I can specify it ? Does that mean I have to uninstall and install again. Please help. There are registry entries under hkey localmachine, software, microsoft,mscrm which point to the web server. I have never tried changing the web server address. As long as the new web server is still using the same database it may work. Honestly I would reinstall "Arch" <anonymous@discussions.microsoft.com> wrote in mes...

Installation of KB982311 Failed
Running current Windows XP Pro SP3 system with Office 2002. Attempted install of latest June 2nd Tuesday updates and KB982311 failed to install. I have the same problem when the system tries to autoupdate KB982311. The error code is 0x80070643 - and the system keeps trying to install this particular update. I am running Windows XP SP3. All other updates from june 11th 2010 installed without problems - only this one failed. I don't have a genuine Microsoft Office 2003 installation - only the free Office Viewers from Microsoft - maye that's the reason, though it has ...

Debug in Release mode?
Old wine in old bottle.. being served by a new bartender :o) How do I do this? pointer would be much appreciated. >Old wine in old bottle.. being served by a new bartender :o) > >How do I do this? The subject or the content? To debug a release build see "How to: Debug a Release Build" in your VC++ help. Dave In addition to what Dave suggested you might want to just do a find on this newsgroup using those keywords. There have been several discussions on that topic in the last few days that should pop up a bunch of links. If you can't find them let me know and ...