|
Have you tried commenting out a few lines at a time until the "error" goes away? If I remember, the WM_PAINT message is a very frequent message so doing extraneous stuff in its handler is not usually a good idea.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
In this case, 0x80000003 means STATUS_BREAKPOINT , the exception that Windows raises when it hits an int 3 instruction (on x86). The debugger normally intercepts this exception and stops the program's execution, showing you where it stopped.
If you're getting an unexpected breakpoint, you may have jumped to an incorrect address, or you may have corrupted your heap, or caused one of your other DLLs to ASSERT. The Windows heap code will cause a breakpoint exception if it detects that the program is running under a debugger and has corrupted the heap.
It might be useful to get the OS debugging symbols to determine whether you've landed in a system function. If you're using Visual Studio .NET (2002 or 2003), you can use Microsoft's Symbol Server to download debugging symbols on demand - this is the preferred option. See http://support.microsoft.com/default.aspx?scid=kb;en-us;319037[^] for more information.
Visual Studio 6 can't use the symbol server, so you can try the Debugging Symbols Packages[^], which are a complete set of symbols for a particular OS. However, these are only updated with every service pack; you may well find that the debugger won't load some of them because they don't match the installed binaries (due to security patches and other hotfixes). You could also try using the Windows Debugging Tools[^], although these are a lot harder to use.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Thanks for the reply Mike. Well the program is breaking on an int 3 instruction. I don't really know how I could have jumped to an incorrect address or corrupted the heap with the code I have though. I downloaded the symbols, but I'm not sure if there's something I have to do to use them. I ran the program again and it broke on assembly code again. The VC debugger shows that it broke in NTDLL. Any ideas? Thanks for the help. I don't know that much about hardcore debugging so I'm kind of at a loss. Thanks again Mike.
I was just checking some other things. After the program terminates there's a line in the output box that says "Second Chance Assertion Faild" and then gives the file. What's a "second chance assertion"? Thanks.
- Aaron
|
|
|
|
|
I forgot to mention that you need to set _NT_SYMBOL_PATH to tell the debugger where to find the OS symbols. It still may not do any good because
At a guess, I think you've ended up at ntdll!DbgBreakPoint , an internal function in NTDLL - a piece of the OS code has explicitly called the break-point function. I still think this may be heap related.
I've found an article http://www.codeproject.com/debug/cdbntsd3.asp[^] which may be helpful.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Thanks again for the help Mike. Read the link and it was informative, but out of my depth. I'll take a harder look at my code though to see if it looks like I'm corrupting the heap anywhere. Thanks again for all the help.
- Aaron
|
|
|
|
|
Hi,
can someone please give me an example of how to
translate a domain name eg. www.codeproject.com
into its IP address.
i have this working for network machine names but
not for domain names.
preferably into CString or unsigned long format.
Thanks
|
|
|
|
|
You could try looking at gethostbyname.
- Aaron
|
|
|
|
|
Aaron
i cannot get that to work..
GetHostAddress("http://www.coderproject.com");
unsigned long DialogClass::GetHostAddress(LPCSTR host)
{
struct hostent *phe;
char *p;
phe = gethostbyname(host);
p = *phe->h_addr_list; // Crash here
return *((unsigned long*)p);
}
any ideas ?
|
|
|
|
|
Try changing:
p = *phe->h_addr_list; to
p = *phe->h_addr;
- Aaron
|
|
|
|
|
Didn't compile it so it may have type-o's...
struct hostent *hp;
unsigned int addr;
struct sockaddr_in name_ip;
if(inet_addr(strDns) == INADDR_NONE)
hp = gethostbyname(strDns);
else
{
addr = inet_addr(strDns);
hp = gethostbyaddr((char *)&addr, sizeof(addr), AF_INET);
}
if(hp == NULL)
{
}
name_ip.sin_addr.s_addr = *((unsigned long*)hp->h_addr);
name_ip.sin_family = AF_INET;
name_ip.sin_port = htons(iPort);
CString strSocketIP = inet_ntoa(name_ip.sin_addr);
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Rob,
thanks for that
but
in flow of execution
strDns = "www.codeproject.com";
hp = gethostbyname(strDns); executes fine
name_ip.sin_addr.s_addr = *((unsigned long*)hp->h_addr); // crash occurs
name_ip.sin_family = AF_INET;
name_ip.sin_port = htons(iPort);
any ideas?
|
|
|
|
|
i am using winsock 1.1
if that might be a problem
in the struct hostent *hp;
i only have the following members:
hp->h_addr_list
hp->h_addrtype
hp->h_aliases
hp->h_length
hp->h_name
i do not have a hp->h_addr member
|
|
|
|
|
I'm not 100% sure, I have only had experence in WinSock2.. you may lookup gethostbyname in google or msdn and see if you can find any Winsock 1.1 examples.. you could snoop through the articles here too.. I'm sure it can't be too hard.
If you still have problems let me konw and I'll see what I can find.
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
I just did a google search and found this right off the bat...
The macro h_addr is defined to be h_addr_list[0] for compatibility with older software.
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
I have a tree control inserted, in which I assigned an imagelist.
When I insert some items, some of them have images assigned to them, even if I don't assign one to them.
This is how I insert my Item in the tree :
TVINSERTSTRUCT tv;
tv.hParent = m_hRootItem;
tv.hInsertAfter = TVI_SORT;
tv.item.mask = TVIF_TEXT | TVIF_PARAM;
CString sText;
sText.LoadString ( IDS_OBJECT_CONSTRUCTED );
tv.item.pszText = (LPTSTR)(LPCTSTR)sText;
tv.item.lParam = NULL;
m_hMyItem = InsertItem( &tv );
but this item use the an image ( index 0 ) from the image list, even if the item does not have the TVIF_IMAGE and TVIF_SELECTEDIMAGE ...
any insights ?
Thanks.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Try fully initializing tv by doing this:
TVINSERTSTRUCT tv;
ZeroMemory (&tv, sizeof (tv));
...
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Thanks, I always forget about that, but, it doesn't seem to do anything special, the item will use the first image in the image list; maybe the tree doesn't like to have items with images and items without.
anyway, I created an "empty" image in the imagelist for those items .
Thanks!
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Hi Maximilien, when your tree control has an associated image list (as your does), you need to specify -1 for the image index of items that aren't supposed to show an image.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
|
during execution of the debug build of my .exe I keep getting this in the debug window ( a lot of them):
Warning: no message line prompt for ID 0x800B.
I removed some edit boxes from my dialog, but I also deleted the message map entries for these controls and their variables. Does anyone know what this might be, or how I can find out? Thanks in advance!!!
If it's broken, I probably did it
bdiamond
|
|
|
|
|
It is likely that you have missed the prompt for menu item(s) that you have added (in the resource editor).
These prompts show in the status bar at the bottom of the application when you hover over the menu item(s).
Note: Toolbar items will have the same prompt as their corresponding menu items.
Ant.
|
|
|
|
|
and how do we do to display such promt in the status bar ?
(i know, get the string into the string table, then write it in the correct statusBar Pane...)
But how, could you give me some short code lines (mt problem is more to get smth in the string table actually)
thanks
TOXCCT >>> GEII power
|
|
|
|
|
CString::LoadString
Be sure that resource exist in the string table
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
thanks! that helped a lot!!
If it's broken, I probably did it
bdiamond
|
|
|
|
|
I want to modify the net-data pacekts before they are passed to the applications. can raw socket or winpcap do?
someone said that SPI can do. but it is only for winsock 2. i hope it also work for the lower version winsock such as winsock 1.1.
Thanks.
|
|
|
|