|
My MSVC 6.0 MFC application crashes for a few people when they come out of StandBy mode when its running. I've never been able to reproduce this myself but I'm wondering what areas to look at that could cause a crash at this time. Here's the Dr. Watson log from the thread that crashes below. It looks at though the code just didn't get loaded again. Any ideas or suggestions on how to debug something like this?
*----> State Dump for Thread Id 0xec4 <----*<br />
<br />
eax=00000001 ebx=00ca2d00 ecx=0000000a edx=7c90eb94 esi=0669daa0 edi=00000000<br />
eip=0124b3c7 esp=0189ff60 ebp=0189ff80 iopl=0 nv up ei pl zr na po nc<br />
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000246<br />
<br />
function: <nosymbols><br />
No prior disassembly possible<br />
0124b3c7 ?? ???<br />
0124b3c9 ?? ???<br />
0124b3cb ?? ???<br />
0124b3cd ?? ???<br />
0124b3cf ?? ???<br />
0124b3d1 ?? ???<br />
0124b3d3 ?? ???<br />
0124b3d5 ?? ???<br />
0124b3d7 ?? ???<br />
FAULT ->0124b3c7 ?? ???<br />
Error 0x00000001<br />
0124b3c9 ?? ???<br />
0124b3cb ?? ???<br />
0124b3cd ?? ???<br />
0124b3cf ?? ???<br />
0124b3d1 ?? ???<br />
0124b3d3 ?? ???<br />
0124b3d5 ?? ???<br />
0124b3d7 ?? ???<br />
0124b3d9 ?? ???<br />
0124b3db ?? ???<br />
<br />
*----> Stack Back Trace <----*<br />
WARNING: Stack unwind information not available. Following frames may be wrong.<br />
ChildEBP RetAddr Args to Child <br />
0189ff5c 000d0670 00000218 0000000a 00000000 0x124b3c7<br />
0189ff80 77c3a3b0 00bda558 00000000 7c9105c8 0xd0670<br />
0189ffb4 7c80b50b 00ca2d00 00000000 7c9105c8 msvcrt!endthreadex+0xa9<br />
0189ffec 00000000 77c3a341 00ca2d00 00000000 kernel32!GetModuleFileNameA+0x1b4<br />
<br />
*----> Raw Stack Dump <----*<br />
000000000189ff60 70 06 0d 00 18 02 00 00 - 0a 00 00 00 00 00 00 00 p...............<br />
000000000189ff70 69 79 6d 0d 79 04 00 00 - 8b 01 00 00 58 a5 bd 00 iym.y.......X...<br />
000000000189ff80 b4 ff 89 01 b0 a3 c3 77 - 58 a5 bd 00 00 00 00 00 .......wX.......<br />
000000000189ff90 c8 05 91 7c 00 2d ca 00 - 05 00 00 c0 8c ff 89 01 ...|.-..........<br />
000000000189ffa0 84 fb 89 01 dc ff 89 01 - 94 5c c3 77 d8 40 c1 77 .........\.w.@.w<br />
000000000189ffb0 00 00 00 00 ec ff 89 01 - 0b b5 80 7c 00 2d ca 00 ...........|.-..<br />
000000000189ffc0 00 00 00 00 c8 05 91 7c - 00 2d ca 00 00 a0 fd 7f .......|.-......<br />
000000000189ffd0 05 00 00 c0 c0 ff 89 01 - 84 fb 89 01 ff ff ff ff ................<br />
000000000189ffe0 f3 99 83 7c 18 b5 80 7c - 00 00 00 00 00 00 00 00 ...|...|........<br />
000000000189fff0 00 00 00 00 41 a3 c3 77 - 00 2d ca 00 00 00 00 00 ....A..w.-......<br />
00000000018a0000 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................<br />
00000000018a0010 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................<br />
00000000018a0020 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................<br />
00000000018a0030 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................<br />
00000000018a0040 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................<br />
00000000018a0050 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................<br />
00000000018a0060 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................<br />
00000000018a0070 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................<br />
00000000018a0080 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................<br />
00000000018a0090 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................
|
|
|
|
|
Wow
Two ideas come to mind.
I see msvcrt!endthreadex in the call stack. If that is at all reasonably correct, then maybe you would want to catch the entrance to the standby mode within your application and prevent your own application from terminating or leaving any threads once standby is about to be 'entered' and then you can leave once you have resumed.
Also, device states might not be identical coming out of standby. Perhaps your worker thread is ineracting with a device which has different state coming out of standy?
Just some ideas, hope they help.
|
|
|
|
|
I know memory leaks are bad ... and that every memory blocks allocted by my 10 fingers should be free by those same 10 fingers, and that's something I do but ...
maybe this is a really newbee question.
On Windows, if I allocate memory ( like MyClass* p = new MyClass ) and I quit the application without deleting it ( delete p ) what really happens to the memory ? Is it reclaimed by the OS ?
Any reference on MSDN on that topic ?
Thanks for the OS cluelessness.
Max.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
In NT and its successors the OS does reclaim the memory and all other resources used by a process when it terminates. W95, W98, and ME are not as well behaved.
|
|
|
|
|
for an MDI project that has multiple Document templates how can i have different toolbars for each of the views
DOC template 1
Doc1
ChildFrame1
View1
DOC template 2
Doc1
ChildFrame1
View2
is there a way to load a toolbar based on the view ?
|
|
|
|
|
An MDI application has multiple child frame windows. Associate the different tool bars with the child frame windows in OnCreate(), exactly the way CMainFrame::OnCreate() does.
|
|
|
|
|
Hello everyone,
I have a big problem while i'm trying to show a popup bar which i run as a thread. The thread is being started by a DLL that i wrote.
i keep getting the message: "Debug Assertion Failed, File-Wincore.cpp , Line - 958 ". I tried to use the solution suggested in msdn regarding the definition of a manage macro : AFX_MANAGE_STATE(AfxGetStaticModuleState())...
but no LUCK.
if anyone know how to make it work out please send your solution.
Thanks,
Erez
Erez
|
|
|
|
|
Maybe you need to create a message queue for your thread prior to generating a window in the same thread. Try calling PeekMessage() right away, so a message queue is generated.
|
|
|
|
|
Hey Everybody!
I wrote this code:
HINSTANCE hInst = ShellExecute(0, <br />
"open", <br />
"C:\\Bonus.exe", <br />
NULL,<br />
NULL, <br />
SW_SHOW);<br />
for some reason the code does NOTHING! it does not execute the exe file.
by the way, it is a flash projector (the exe file).
does anyone has any idea what may cause this problem, and how to solve it?
Thanks!!!
|
|
|
|
|
Check the return value... if its less than or equal to 32, then an error has occured. Look up ShellExecute in MSDN for the error codes.
|
|
|
|
|
thanks!
but I already fixed it.
it seems that I had a typo somewhere in my code, but for some reason the compiler ignored it... (?!)
thanks anyone
|
|
|
|
|
Try this
WinExec("c:\\Bonus.exe",1);
m0n0
|
|
|
|
|
I couldn't find an appropriate forum ;o)
Does anyone know if it is possible to write a macro in DevStudio to open the build directory of the executable/dll/lib that you've just built?
On a per configuration basis?
I'm forever having to browse for those directories and it seems like such a simple thing...but I've looked at the macro help and the DevStudio objects and I can't see anything likely ...
Cheers,
Dan
|
|
|
|
|
hello friends
i am making a project on intrusion detection system in which i m using genetic algorithm and want some guidance in genetic algorithm.
thanx
bye
|
|
|
|
|
I'd suggest you use the fork() function.
Chris Meech
I am Canadian. [heard in a local bar]
Gently arching his fishing rod back he moves the tip forward in a gentle arch releasing the line.... kersplunk [Doug Goulden]
Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]
|
|
|
|
|
There are some places on the web for genetic algorithms, e.g http://lancet.mit.edu/ga. I suggest reading a book of David Goldberg about GA.
|
|
|
|
|
I defined the variable as
CCriticalSection m_sync;
and used the variable m_sync as
m_sync.Lock();
...
m_sync.Unlock();
but there were the errors as follows:
C:\Documents and Settings\ACER\桌面\wzy1\wzy1View.cpp(20) : error C2146: syntax error : missing ';' before identifier 'm_Sync'
C:\Documents and Settings\ACER\桌面\wzy1\wzy1View.cpp(20) : error C2501: 'CCriticalSection' : missing storage-class or type specifiers
C:\Documents and Settings\ACER\桌面\wzy1\wzy1View.cpp(20) : fatal error C1004: unexpected end of file found
Generating Code...
Error executing cl.exe.
Why is that?
I am rather confused!
Thank you!
|
|
|
|
|
Did you include afxmt.h ?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
You might also want to look at using InitializeCriticalSection(), EnterCriticalSection(), and LeaveCriticalSection()
|
|
|
|
|
Hi all,
I am struggling trying to write a function that will take a hex, octal or binary number as a string, and then convert it to an integer, and return that as a string.
The catch?
The value is going to be substatially bigger than INT_MAX. Unfortunatly to meet my needs, this is also going to have to be a static function(s), so no new classes with overloaded operators.
Any ideas?
Cheers,
MadFruit
|
|
|
|
|
Have you looked into strtoul() ? For example:
unsigned long ulNumber;
char *endptr;
ulNumber = strtoul("0x123", &endptr, 16);
ulNumber = strtoul("110100111", &endptr, 2);
ulNumber = strtoul("1053", &endptr, 8);
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Unfortunatly, and unsigned long, is not likely to be large enough. The binary values that I will potentailly have to handle could have N bits. Existing types are not going to help much I think.
The route I believe I have to take is to try and cut the numbers down to handlable, convertable sizes, and then somehow add them together. But I am not really sure.
|
|
|
|
|
I am working on similar project, and i have written four functions :
CString Add(CString s1,CString s2)
CString Sub(CString s1,CString s2)
CString Multiply(CString s1,CString s2)
CString Divide(CString s1,CString s2)
which as you see return CString values .
and finally converting to any other base is no more a problem ,
using these functions you can convert to binary any number,using simple algorithm dividing by 2 (16 if Hex and 8 if Oct) ,,,,.
But my problem is that it takes too long to convert for example 500 digit number to binary.
So i think you'll also have to write smth .similar to these functions first and then think of converting from one base to another
Good Luck!
m0n0
|
|
|
|
|
Hi All...
This question has gotta be really simple... I'm trying to read 8 characters from stdin. So if the user types 1233456789abcdef<enter>, my string buffer (of size 9) gets filled with "12345678\0". If the user just hits enter, then I want the string to just get "\0" in it. Sounds simple right?
I've tried using
char text[9];
memset(text, 0, sizeof(text);
scanf("%8s", text); Which works fine, except if you want to enter blank - just hitting enter, scanf won't stop scanning until you type something, and then hit enter.
Next I tried using fgets. Which works better in this respect:
char text[9];
memset(text, 0, sizeof(text);
fgets(text, 9, stdin); So if you just hit enter, then all that ends up in text is "\0". Fine. But if the user types 123456789abcdef<enter>, then "12345678" gets transfered into text , but the remaining charachters "9abcdef" seem to linger in stdin, so if you call scanf, or fgets immediatly afterwards e.g. for a second parameter input, the function sees this input, rather than asking for some fresh input (which is what I want) - even though they're just spurious charachters that I don't care about! So is there a better way of doing this? possibly a way of discarding the spurious characters.
[EDIT]Putting fseek(stdin, 0, SEEK_END); between my fseek s and scanf s seems to help. Is this a good way of doing it?[/EDIT]
Joel Holdsworth
Wanna give me a job this summer?
Check out my online CV and project history[^]
|
|
|
|
|