|
Thanks a lot. I'll check into it...
|
|
|
|
|
Hi there,
I have an application interfacing two other application one windows base and another one Linux base and my application receives messages from the Linux base app. and sends that to the windows base one and vise versa, the messages from Linux base app. in ASCII hex and I change it to XML string and send it to the windows base app. and also get in XML string from that and convert it to HEX for the Linux base app.
The problem is that after a while I get the Debug Assertion Failed dbgdel.cpp Line 42
Message and my application crashes.
Any idea would be appreciated.
Thanks
|
|
|
|
|
That's because you used ++ instead of + in line 21, making the counter in line 42 overflow.
Insert a comment line on line 41, this should fix it, or bring the problem to line 43.
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
|
Thanks for the tip but I am not sure what you mean by making overflow in line 42 ( what class?) this the first time I see dbgdel.cpp unless it is a Windows class (Library)(I do not have such class name in my app.).
Thanks,
|
|
|
|
|
nahitan wrote: after a while I get the Debug Assertion Failed dbgdel.cpp Line 42
Assertions in delete are probably from your code trashing memory it doesn't own.
You'll need to debug your code and find all the places you are overunning the end of allocated
memory. If that doesn't work, blame Linux.
|
|
|
|
|
Mark Salsbery wrote: ...blame Linux.
Why not just save time and do that first?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thanks
|
|
|
|
|
Hi there,
I have an application interfacing two other application one windows base and another one Linux base and my application receives messages from the Linux base app. and sends that to the windows base one and vise versa, the messages from Linux base app. in ASCII hex and I change it to XML string and send it to the windows base app. and also get in XML string from that and convert it to HEX for the Linux base app.
The problem is that after a while I get the Debug Assertion Failed dbgdel.cpp Line 42
Message and my application crashes.
Any idea would be appreciated.
Thanks
|
|
|
|
|
nahitan wrote: Any idea would be appreciated.
Have you considered looking at line 42 of dbgdel.cpp to see why the assertion is firing?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
In addition to what David said, you can still use your debugger to narrow the problem (it's much faster to get information from your debugger than through a forum for these kind of problems).
|
|
|
|
|
for example, when we click Start, windows will redraw Start button and draw Start menu
is it possible to detect and get position of it?
|
|
|
|
|
Yes it is possible, but there are a lot of factors that go into building an update region.
The two main apis are GetUpdateRgn() and GetClipRgn() . But for something like the Start menu, the only way to get the region would be through hooks since regions are only really used within the process.
|
|
|
|
|
I have a rebar control which I have located at the bottom of my window. When a band is removed from the rebar it relocates to the top of the window and cannot be moved. I've tried all the standard calls for moving a window but to no avail. No idea why it relocates in the first place. Anyone seen this before?
|
|
|
|
|
More info: I had been trapping the Delete Band message in the parent and then calling MoveWindow from there. I moved the MoveWindow call to the derived CReBar class and this appears to be solving the problem. Still no explanation for why the ReBar relocates after removing a band.
|
|
|
|
|
using C++ can i upgrade my frimwire of my MP3 player and add some codecs which make it able to play .RM Real Media files
Thank you very much !!
|
|
|
|
|
|
Maximilien wrote: l o l
I'm not seeing what's so funny, but your letters look somewhat like a TIE fighter.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I prefer finding it funny than sad.
|
|
|
|
|
Hi all,
I have this string, that would look something like this:
ZA123654PCNAME
I want to break the string apart like this:
ZA123654 (Please note that this piece is not constant)
PCNAME
I have tried to get the secondnd part (by doing the following: below), but how can I get the first part, this is if I'm doing it correctly..
<br />
if(strncmp((char *)strstr(Request,(char*)"PCNAME"),(char *)"PCNAME",6)==0)<br />
Thanx in advance
-- modified at 8:57 Thursday 9th November, 2006
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
On which 'parameters' do you split the string ? I mean, how do you know which is the first part of the string and which is the last part of the string ? Are all the strings the same size ? If not, is there a delimiter character ? Or what ? By looking at your code, it seems that the last part is always PCNAME and is always 6 char long.
So, you can then compute the lenght of the first part:
int Len = strlen(Request) - 6;
Then, you can copy up to Len characters of your string in a buffer:
strncpy(szBuff,Request,Len);
If that's not the case, please provide more information about how you want to split the string.
|
|
|
|
|
My bad Cédric ...
I forgot to mention that there is a space between the first part and the PCNAME. And yes PCNAME will always be a constant.
But thank you so much, I really appreciate the help (code provided works).
Regards
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Just for fun and if your interrested in that solution,
try this :
char string[] = "abc def ghi";<br />
char * token = strtok(string, " ");<br />
while( token )<br />
{<br />
printf("[%s]\n", token);<br />
token = strtok(NULL, " ");<br />
}
|
|
|
|
|
Thanx XtremDev ... I'll check it out ...
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
« Programm3r » wrote: if(strncmp((char *)strstr(Request,(char*)"PCNAME"),(char *)"PCNAME",6)==0)
In this context, both strstr() and strncmp() are doing redundant work. If strstr() returns a non-NULL pointer, it means that "PCNAME" was found in Request . Therefore, there's no need to follow that with a call to strncmp() . Similarly, if strstr() returns a NULL pointer, strncpy() will fail. Make sense?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|