Click here to Skip to main content
15,908,173 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MFC modal Pin
Matt Gullett30-Jul-01 18:01
Matt Gullett30-Jul-01 18:01 
GeneralI need some help with some errors... Pin
30-Jul-01 7:54
suss30-Jul-01 7:54 
GeneralRe: I need some help with some errors... Pin
Tomasz Sowinski30-Jul-01 9:38
Tomasz Sowinski30-Jul-01 9:38 
GeneralRe: I need some help with some errors... Pin
30-Jul-01 16:15
suss30-Jul-01 16:15 
GeneralRe: I need some help with some errors... Pin
Christian Graus30-Jul-01 16:31
protectorChristian Graus30-Jul-01 16:31 
GeneralRe: I need some help with some errors... Pin
Matt Gullett30-Jul-01 17:52
Matt Gullett30-Jul-01 17:52 
GeneralRe: I need some help with some errors... Pin
31-Jul-01 10:50
suss31-Jul-01 10:50 
GeneralRe: I need some help with some errors... Pin
Matt Gullett31-Jul-01 13:31
Matt Gullett31-Jul-01 13:31 
Off the top of my head, I can think of 3 things you can try.

1) Make sure your warning level is set to level 4. This will probably not find the error, but its worth a shot and is always a good place to start.

2) If you have access to Purify or BoundsChecker, either will almost always find this kind of problem.

3) This is also not guaranteed, but has proven succesful for me on ocassion. It requires modifying your code, but makes for a simple and performance sensitive check. If you get in the habbit of coding this way, it can solve problems later.

When you have code which reads like below.

char szBuffer[20];

for (int iX = 0; iX < 20; iX++)
{
}

change the code to be

char szBuffer[22];
szBuffer[20] = 0; szBuffer[21] = 255;

for (int iX = 0; iX < 20; iX++)
{
}

ASSERT(szBuffer[21] = 255);


This also mean that when allocating blocks of memory, you will always need to allocate 1 or 2 extra bytes and set the last byte to some value which is unlikely to properly exist in the data. Then before freeing the data, check the value of the last byte for the value you gave it, if its not what you set it to, you just overan your memory.

Note: This is not a guaranteed check because it is possible that the value written into the check byte was the value you put there to begin with, but its still a good preaution.
GeneralRe: I need some help with some errors... Pin
Matt Gullett31-Jul-01 13:33
Matt Gullett31-Jul-01 13:33 
QuestionWhen is m_wndToolBar initially sized inplace? Pin
Kristian Nilssen30-Jul-01 7:50
Kristian Nilssen30-Jul-01 7:50 
GeneralRemove icon from taskbar Pin
Sreejumon30-Jul-01 7:15
Sreejumon30-Jul-01 7:15 
GeneralRe: Remove icon from taskbar Pin
Tomasz Sowinski30-Jul-01 7:26
Tomasz Sowinski30-Jul-01 7:26 
GeneralRe: Remove icon from taskbar Pin
Sreejumon30-Jul-01 7:33
Sreejumon30-Jul-01 7:33 
GeneralRe: Remove icon from taskbar Pin
Tomasz Sowinski30-Jul-01 7:38
Tomasz Sowinski30-Jul-01 7:38 
GeneralRe: Remove icon from taskbar Pin
Sreejumon30-Jul-01 8:05
Sreejumon30-Jul-01 8:05 
GeneralRe: Remove icon from taskbar Pin
Tomasz Sowinski30-Jul-01 8:36
Tomasz Sowinski30-Jul-01 8:36 
GeneralCRichEdit & Mouse Move Pin
AJ12330-Jul-01 6:35
AJ12330-Jul-01 6:35 
GeneralRe: CRichEdit & Mouse Move Pin
Kevin Cook30-Jul-01 7:42
Kevin Cook30-Jul-01 7:42 
GeneralVC Project File Format Pin
Steve Thresher30-Jul-01 5:41
Steve Thresher30-Jul-01 5:41 
GeneralRe: VC Project File Format Pin
Carlos Antollini30-Jul-01 5:59
Carlos Antollini30-Jul-01 5:59 
GeneralRe: VC Project File Format Pin
Steve Thresher30-Jul-01 6:41
Steve Thresher30-Jul-01 6:41 
GeneralRe: VC Project File Format Pin
J Patel30-Jul-01 7:04
J Patel30-Jul-01 7:04 
GeneralRe: VC Project File Format Pin
J Patel30-Jul-01 10:52
J Patel30-Jul-01 10:52 
GeneralRe: VC Project File Format Pin
Tomasz Sowinski30-Jul-01 7:17
Tomasz Sowinski30-Jul-01 7:17 
GeneralRe: VC Project File Format Pin
Steve Thresher30-Jul-01 22:44
Steve Thresher30-Jul-01 22:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.