|
-
August 24th, 2012, 09:40 AM
#16
Re: ASSERT when opening dialog box
 Originally Posted by bkelly
On start of the application. From the OP: Environment: Windows XP Pro, Visual Studio 2008, MFC, C++
When I looked at the call stack, none of the modules I wrote were listed...
Please, define "start of the application".
And it could help if you showed the called stack...
BTW, what global variables did you define in you application? Perhaps, there is a problem with initializing of some of those variables?
Victor Nijegorodov
-
August 24th, 2012, 09:42 AM
#17
Re: ASSERT when opening dialog box
 Originally Posted by bkelly
On start of the application. From the OP: Environment: Windows XP Pro, Visual Studio 2008, MFC, C++
When I looked at the call stack, none of the modules I wrote were listed. I am not sufficiently well versed in MS internals to troubleshoot and interpert their code. (I am not claiming the problem is in their code, but the symptoms originate from within their code.) Note again, I made a change, solicted the error, reversed the change, eliminated the error. That's a a pretty good basis for concluding that my change was not well advised.
Maybe as I get better at this I will be more able to investigate this type of problem. In the mean time, I have code to write and test.
But you shouldn't pick up a really bad habit because of one problem you were unable to solve. In general, it's still better to create local objects rather than put them on the heap using new whenever you can.
-
August 24th, 2012, 11:10 AM
#18
Re: ASSERT when opening dialog box
 Originally Posted by GCDEF
But you shouldn't pick up a really bad habit because of one problem you were unable to solve. In general, it's still better to create local objects rather than put them on the heap using new whenever you can.
Yes, you are correct. I just went back and looked. There are couple of significant fixed arrays (not dynamic as I stated earlier), one of a structure with 500K entries. (yes, absolutely required) And I neglected to mention that this particular class has about 500 lines in the .h file and 2400 lines of code in the cpp. (the executable code is broken into two files, one for all the configuration code and the other for all the code that runs real time.) It also has a sub class that it creates to drive the TCP/IP communications (rather simple protocol) and uses a lot of structures.
I am guessing that this may be a bit much to make static. Am I wrong.
Re: Please, define "start of the application".
When I press F5 in the debugger or when I double click on the icon that is linked to the .exe created by Visual Studio. Why is that not clear? To me, the entire lump of code in this project/solution is my application.
-
August 24th, 2012, 11:18 AM
#19
Re: ASSERT when opening dialog box
 Originally Posted by bkelly
Re: Please, define "start of the application".
When I press F5 in the debugger or when I double click on the icon that is linked to the .exe created by Visual Studio. Why is that not clear? To me, the entire lump of code in this project/solution is my application.
It was "not clear" because you had not answered yet was before WinMain or before CWinApp::InitInstance or before something else... You didn't tell us where exactly did you set some breakpoints that did not fire...
So, again: if it happens before your CWinApp derived class ctor then have a look at all of your global variables.
Victor Nijegorodov
-
August 24th, 2012, 11:38 AM
#20
Re: ASSERT when opening dialog box
 Originally Posted by bkelly
Yes, you are correct. I just went back and looked. There are couple of significant fixed arrays (not dynamic as I stated earlier), one of a structure with 500K entries. (yes, absolutely required) And I neglected to mention that this particular class has about 500 lines in the .h file and 2400 lines of code in the cpp. (the executable code is broken into two files, one for all the configuration code and the other for all the code that runs real time.) It also has a sub class that it creates to drive the TCP/IP communications (rather simple protocol) and uses a lot of structures.
I am guessing that this may be a bit much to make static. Am I wrong.
Re: Please, define "start of the application".
When I press F5 in the debugger or when I double click on the icon that is linked to the .exe created by Visual Studio. Why is that not clear? To me, the entire lump of code in this project/solution is my application.
Lines of code is irrelevant. The problem was likely the arrays. Those should have been allocated using new because of their size or better yet replaced with an stl container that will do the memory management for you.
Why are we talking about static now?
Last edited by GCDEF; August 24th, 2012 at 11:40 AM.
-
August 24th, 2012, 12:04 PM
#21
Re: ASSERT when opening dialog box
 Originally Posted by bkelly
Yes, you are correct. I just went back and looked. There are couple of significant fixed arrays (not dynamic as I stated earlier), one of a structure with 500K entries. (yes, absolutely required)
What is the sizeof() each one of these structs? Whatever that is, the amount of space is 500,000 * sizeof(the_struct). If that entry is anything above 4 bytes in size, that's over 2,000,000 bytes. That alone blows out the default automatic size limits (which I believe is either 1Meg or 2Meg).
Regards,
Paul McKenzie
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|