Click here to Skip to main content
15,921,941 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to use WIA in VC 2005 Pin
tgchuhan9-Sep-06 1:17
tgchuhan9-Sep-06 1:17 
GeneralRe: How to use WIA in VC 2005 Pin
led mike11-Sep-06 5:03
led mike11-Sep-06 5:03 
QuestionPropertyPage with ListCtrl Pin
DanYELL7-Sep-06 8:48
DanYELL7-Sep-06 8:48 
AnswerRe: PropertyPage with ListCtrl Pin
Jethro637-Sep-06 9:42
Jethro637-Sep-06 9:42 
GeneralRe: PropertyPage with ListCtrl Pin
DanYELL7-Sep-06 12:42
DanYELL7-Sep-06 12:42 
QuestionRe: PropertyPage with ListCtrl Pin
David Crow8-Sep-06 4:29
David Crow8-Sep-06 4:29 
QuestionRe: PropertyPage with ListCtrl Pin
David Crow8-Sep-06 4:30
David Crow8-Sep-06 4:30 
QuestionHow to extract "rich text" from a windows control? Pin
ed welch7-Sep-06 8:33
ed welch7-Sep-06 8:33 
AnswerRe: How to extract "rich text" from a windows control? Pin
Waldermort7-Sep-06 8:50
Waldermort7-Sep-06 8:50 
GeneralRe: How to extract "rich text" from a windows control? Pin
ed welch7-Sep-06 8:52
ed welch7-Sep-06 8:52 
GeneralRe: How to extract "rich text" from a windows control? Pin
ed welch7-Sep-06 10:24
ed welch7-Sep-06 10:24 
GeneralRe: How to extract "rich text" from a windows control? Pin
Naveen7-Sep-06 21:46
Naveen7-Sep-06 21:46 
AnswerRe: How to extract "rich text" from a windows control? Pin
ed welch7-Sep-06 13:55
ed welch7-Sep-06 13:55 
QuestionC++ Refactory Pin
knoxpointer7-Sep-06 8:04
knoxpointer7-Sep-06 8:04 
AnswerRe: C++ Refactory Pin
DaTxomin7-Sep-06 9:06
DaTxomin7-Sep-06 9:06 
QuestionProblems with realloc - heap corruption Pin
nadiric7-Sep-06 6:52
nadiric7-Sep-06 6:52 
AnswerRe: Problems with realloc - heap corruption Pin
nadiric7-Sep-06 7:03
nadiric7-Sep-06 7:03 
GeneralRe: Problems with realloc - heap corruption Pin
Waldermort7-Sep-06 7:20
Waldermort7-Sep-06 7:20 
GeneralRe: Problems with realloc - heap corruption Pin
nadiric7-Sep-06 7:24
nadiric7-Sep-06 7:24 
GeneralRe: Problems with realloc - heap corruption Pin
Waldermort7-Sep-06 7:28
Waldermort7-Sep-06 7:28 
AnswerRe: Problems with realloc - heap corruption Pin
Jun Du7-Sep-06 7:15
Jun Du7-Sep-06 7:15 
GeneralRe: Problems with realloc - heap corruption Pin
nadiric7-Sep-06 7:22
nadiric7-Sep-06 7:22 
GeneralRe: Problems with realloc - heap corruption Pin
Jun Du7-Sep-06 7:43
Jun Du7-Sep-06 7:43 
GeneralRe: Problems with realloc - heap corruption Pin
Zac Howland7-Sep-06 8:39
Zac Howland7-Sep-06 8:39 
AnswerRe: Problems with realloc - heap corruption Pin
Stephen Hewitt8-Sep-06 2:03
Stephen Hewitt8-Sep-06 2:03 
When you get heap corruption the actual cause need not be near where the problem manifests itself; often there is no obvious connection. He's what I'd try first:
 - If you haven't already got it, down and install WinDBG[^]. This is an absolute essential and every C/C++ developer should have the latest version installed at all times.
 - Select "Start->All Programs->Debugging Tools for Windows->Global Flags".
 - Select the "Image File" tab.
 - Type the name your application in the "Image: (TAB to refresh)" edit box then press TAB. The name should be the whole file name and extension but not the full path.
 - Tick "Enable page heap", "Enable heap tail checking", "Enable heap free checking", "Enable heap parameter checking", "Enable heap validation on call" & "Create user mode stack trace database".
 - Press "OK".

Now run your application. It will run many, many times slower then normal and consume huge amounts of memory but most heap errors will cause a break point to be generated as soon as the heap error occurs. If you use WinDBG as your debugger you can also get access to stack traces for each allocation. For example for a double free you can get a stack trace to the first free and a break point is generated for the second. It's good to have a machine with the fastest possible CPU and as much RAM as you can afford for debugging processes with the page heap.

After you've finished you'll want to turn the page heap off again for your process. Follow the steps above but uncheck all the tick boxes.

Steve

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.