|
Your program will probably run ok, but if you're lucky you might be able to eliminate the exception.
While running in debug mode, select the Debug | Exceptions menu. In the Exceptions dialog, scroll to the bottom and select the Microsoft C++ exception entry, and change the action to stop always.
The next time the exception occurs, you will interrupt the program. Since this one comes from the kernel, you probably won't be able to see anything more than an asm dump, but if there is a reasonable call stack available you might be able to track down a likely cause.
Alternatively, you might be able to break and step through the code you can see until you trip it.
These can be mysterioius and hard to find though, especially in GDI or kernel code. But worth a look - very nice to be able to get rid of output window clutter!
|
|
|
|
|
|
I keep getting an access violation when a certain dialog box closes in my program.
When I ran it through the debugger, I found that the error is occuring
somewhere withing mfc42.dll, where I can't actually see the code and know
what it is doing. Here is the line the debugger did give me though:
5F404FCF mov eax,dword ptr [ecx]
Can anyone tell me what this is trying to do? I have been stuck on this problem
for a while and haven't been able to track it down. The call stack was also fairly useless:
MFC42! 5f404fcf()
MFC42! 5f401dca()
MFC42! 5f401aff()
MFC42! 5f401a88()
MFC42! 5f401a10()
MFC42! 5f4019cf()
KERNEL32! bff7363b()
KERNEL32! bff942e7()
Thanks,
Adam
pandcc3@comwerx.net
http://members.xoom.com/Q3KillStats
|
|
|
|
|
Usually, posting the problem 4 times does not solve it
More seriously, did you try the debug version? Does it have the same problem?
I remember that once I had the same problem, and it only came out in the Release version, but I can't remember what was the cause.
Before your test, try to do a complete rebuild. Sometimes this helps.
Then, you should look at your dialog code first, instead of some address in MFC42.DLL .
Probably you are passing a temporary object to a member function, which stores it somewhere. When the object falls out of scope it is destroyed; so when you close the dialog, some other private member tries to access an object that no longer exists and you have an Access Violation.
Look for the calls in which you pass a pointer, check if that functions set some internal variable with that pointer. If so, the pointed object should live as long as the dialog and you should make it a member of your derived dialog class.
Good luck,
Paolo
|
|
|
|
|
hmm didn't think I posted 4 times... sorry.
At first it occured only in the release version, so I played with the debug settings a little until it basically mimicked the release, but I could run it through the debugger. I don't call any functions, except for DoModal. I call a couple from within (sometimes this dialog also functions as a splash screen, so I have to close it automatically after x seconds). Stepping through, the most I can narrow done where the error occured was to sometime between the call to EndDialog() and the point where DoModal returns. I don't have any pointers... the only thing odd I have done is to apply a bitmap background to the dialog and i have got a class to make static text into hyperlinks. I have looked at the code for both and don't think that they are causing the problem, but I'll go take another look at them.
|
|
|
|
|
If the debug version is OK, maybe you are using some uninitialized variable. Try compiling at warning level 4 and ignore all the warnings coming from windows include files.
If you try to call EndDialog at the end of your OnInitDialog, what happens?
|
|
|
|
|
>If the debug version is OK, maybe you are using some
>uninitialized variable. Try compiling at warning level 4
>and ignore all the warnings coming from windows include
>files.
Did that, had a couple warnings about variables being initialized but never referenced, and a couple about formal paramters never being referenced (things like pDC in OnDraw for my view, which I never use)
>If you try to call EndDialog at the end of your >OnInitDialog, what happens?
Same errors
sigh... I may just put together a small project that uses this and send it to you so you can look at it... that ok?
Thanks,
Adam
pandcc3@comwerx.net
|
|
|
|
|
I would be happy to help you, but not this days.
If you wish, you may send me your little project next week, after the 7th of June. I will be too busy 'til then.
If you may wait...
Cheers,
Paolo
|
|
|
|
|
This problem often occurs if you are trying to delete or access object that does not exist.
In the debugger you will be able to see call stack, which can let you identify which line in your code is causing this problem.
|
|
|
|
|
I wish it were that simple... I never access the dialog box... all I call is the constructor when i first make it, and then DoModal(). thats it... and the call stack was useless:
MFC42! 5f404fcf()
MFC42! 5f401dca()
MFC42! 5f401aff()
MFC42! 5f401a88()
MFC42! 5f401a10()
MFC42! 5f4019cf()
KERNEL32! bff7363b()
KERNEL32! bff942e7()
|
|
|
|
|
I keep getting an access violation when a certain dialog box closes in my program.
When I ran it through the debugger, I found that the error is occuring
somewhere withing mfc42.dll, where I can't actually see the code and know
what it is doing. Here is the line the debugger did give me though:
5F404FCF mov eax,dword ptr [ecx]
Can anyone tell me what this is trying to do? I have been stuck on this problem
for a while and haven't been able to track it down. The call stack was also fairly useless:
MFC42! 5f404fcf()
MFC42! 5f401dca()
MFC42! 5f401aff()
MFC42! 5f401a88()
MFC42! 5f401a10()
MFC42! 5f4019cf()
KERNEL32! bff7363b()
KERNEL32! bff942e7()
Thanks,
Adam
pandcc3@comwerx.net
http://members.xoom.com/Q3KillStats
|
|
|
|
|
I keep getting an access violation when a certain dialog box closes in my program.
When I ran it through the debugger, I found that the error is occuring
somewhere withing mfc42.dll, where I can't actually see the code and know
what it is doing. Here is the line the debugger did give me though:
5F404FCF mov eax,dword ptr [ecx]
Can anyone tell me what this is trying to do? I have been stuck on this problem
for a while and haven't been able to track it down. The call stack was also fairly useless:
MFC42! 5f404fcf()
MFC42! 5f401dca()
MFC42! 5f401aff()
MFC42! 5f401a88()
MFC42! 5f401a10()
MFC42! 5f4019cf()
KERNEL32! bff7363b()
KERNEL32! bff942e7()
Thanks,
Adam
pandcc3@comwerx.net
http://members.xoom.com/Q3KillStats
|
|
|
|
|
I keep getting an access violation when a certain dialog box closes in my program.
When I ran it through the debugger, I found that the error is occuring
somewhere withing mfc42.dll, where I can't actually see the code and know
what it is doing. Here is the line the debugger did give me though:
5F404FCF mov eax,dword ptr [ecx]
Can anyone tell me what this is trying to do? I have been stuck on this problem
for a while and haven't been able to track it down. The call stack was also fairly useless:
MFC42! 5f404fcf()
MFC42! 5f401dca()
MFC42! 5f401aff()
MFC42! 5f401a88()
MFC42! 5f401a10()
MFC42! 5f4019cf()
KERNEL32! bff7363b()
KERNEL32! bff942e7()
Thanks,
Adam
pandcc3@comwerx.net
http://members.xoom.com/Q3KillStats
|
|
|
|
|
Hello.
Q: How should I package our newly developed app-framework/architecture (a set of base-classes and a database-access-COM-class-generator) in order to get the average newbie to use the framework instead of yet another homebrew?
The problem now is that the framework is great, but it is tedious and error prone to set up VC++ to use the framework for a new app; i.e.
* create 2 new ATL/COM-projects
* feed the generator a DSN
* add a dozen shared .cpp/.h-files
* paste a number of generated .idl-snippets into the project's .idl file
* generate a few "dummy" ATL Objects using the existing ATL Object Wizard
* replace the dummy files with the "real" files,
* #import a few libraries in stdafx.h in the correct order * also some basic project settings needs to be done once and for all (C++ exception handling on)
* etc etc etc.
Ideally I guess it would be something like the "ATL/COM AppWizard" that sets everything up the correct way (in 5 seconds instead of 2 hours of following a 50+ step guide on paper).
Anyone tried writing such an add-in? Any other suggestions how to make this accessible?
thanks!
/Martin
|
|
|
|
|
Hello.
Q: How should I package our newly developed app-framework/architecture (a set of base-classes and a database-access-COM-class-generator) in order to get the average newbie to use the framework instead of yet another homebrew?
The problem now is that the framework is great, but it is tedious and error prone to set up VC++ to use the framework for a new app; i.e.
* create 2 new ATL/COM-projects
* feed the generator a DSN
* add a dozen shared .cpp/.h-files
* paste a number of generated .idl-snippets into the project's .idl file
* generate a few "dummy" ATL Objects using the existing ATL Object Wizard
* replace the dummy files with the "real" files,
* #import a few libraries in stdafx.h in the correct order * also some basic project settings needs to be done once and for all (C++ exception handling on)
* etc etc etc.
Ideally I guess it would be something like the "ATL/COM AppWizard" that sets everything up the correct way (in 5 seconds instead of 2 hours of following a 50+ step guide on paper).
Anyone tried writing such an add-in? Any other suggestions how to make this accessible?
thanks!
/Martin
|
|
|
|
|
Hi,
I have a vector object that has some elements in it and I want to remove an item completly from
the vector. Here is what I mean,
vector<int> inV;
for (i=0; i<10; i++)
inV.push_back(i);
I would like to call a function that will remove one of the items and leave me with 9 elements in
the vector. I tried using remove(...), but that doesn't do what I want. If I use remove, I have to
copy the valid elements from one vector to another and I don't really want to do that each time
I have to delete an element. If this is possible please let me know.
Thank in advance
|
|
|
|
|
what about using the std::vector::erase() function to delete a single element or the std::vector::clear() function to remove 'em all?
|
|
|
|
|
Hi Uwe,
I think I can use erase() to delete a single element. I know there had to be an easier way, thanks allot.
|
|
|
|
|
Hi,
I have a vector object that has some elements in it and I want to remove an item completly from
the vector. Here is what I mean,
vector<int> inV;
for (i=0; i<10; i++)
inV.push_back(i);
I would like to call a function that will remove one of the items and leave me with 9 elements in
the vector. I tried using remove(...), but that doesn't do what I want. If I use remove, I have to
copy the valid elements from one vector to another and I don't really want to do that just each time
I have to delete an element. If this is possible please let me know.
Thank in advance
|
|
|
|
|
I have seen Richedit controls with background images on them.
I would like to do this as well. I can do this with a regual CEdit control by catching the WM_CTLCOLOR message to set the DC mode to TRANSPARENT before the control begins
drawing itself - however the RichEdit control doesn send this message. Does anyone have any suggestions at all?
|
|
|
|
|
I have been trying to access a file right after it has been created at run-time. The file is created in an
Initializing Dialog then the name of the file is sent to another dialog. The second dialog can't find the
file (using CFileFind) on the first call. If I cancel the second Dialog, keep the application running and call
the first Dialog again the application finds the file. Can anyone tell me why this is?
Is there a way to find the file the first time through? Any help would be greatly appreciated.
|
|
|
|
|
Maybe you must flush or even close the file handle so that the file is actually written and not somewhere in the write-cache?
|
|
|
|
|
thanx for the help. Unfortunately, I tried to do both on the same file handle and it still doesn't work.
I had used CStdioFile to create the file and changed it to CFile thinking it might make a difference and
still nothing. Any other suggestions?
|
|
|
|
|
hi!!
i'm currently making a sound player (ok, let's just say it's a wave player), and i've implemented a spectrum analyser for the visualisation. BUT :
a. why my analyser went off first before i hear the actual sound being played?
b. how can i fix that problem? (winamp and other sound players are able to synch the vis and the output)
i'm using the Win32 wave API functions btw.
thanks!!!
|
|
|
|
|
How do I close a program that I have launched using ShellExecute()
I get an HINSTANCE back
can I use this object to close the program
?
Thanx in advance
Alfadhly
|
|
|
|