Click here to Skip to main content
15,888,579 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralSOLVED Re: strcpy dilemma - it works half way Pin
Vaclav_4-Aug-15 7:41
Vaclav_4-Aug-15 7:41 
AnswerRe: strcpy dilemma - it works half way Pin
Arthur V. Ratz13-Aug-15 18:54
professionalArthur V. Ratz13-Aug-15 18:54 
QuestionMsbuild for VC++ project having path errors Pin
code_az3-Aug-15 12:54
code_az3-Aug-15 12:54 
Questionruntime error due to corruption of heap Pin
Member 93502372-Aug-15 22:22
Member 93502372-Aug-15 22:22 
AnswerRe: runtime error due to corruption of heap Pin
Member 93502372-Aug-15 22:33
Member 93502372-Aug-15 22:33 
SuggestionRe: runtime error due to corruption of heap Pin
David Crow3-Aug-15 2:12
David Crow3-Aug-15 2:12 
AnswerRe: runtime error due to corruption of heap Pin
Daniel Pfeffer3-Aug-15 0:52
professionalDaniel Pfeffer3-Aug-15 0:52 
AnswerRe: runtime error due to corruption of heap Pin
Jochen Arndt3-Aug-15 2:13
professionalJochen Arndt3-Aug-15 2:13 
This is usually sourced by writing to an array with an out of bound index.

So you must check all your allocated arrays (which may include arrays that are allocated by library functions). Starting with your own ones, search for any call to new as array; e.g.:
C++
type arrayName = new type[size];

Then for each array check the accesses for invalid indexes (index < 0 or >= size). You can do this manually by reading your source or by guarding all accesses with assertions in debug builds:
C++
assert(index > 0 && index < arrayNameSize);
arrayName[index] = someValue;


Your posted code does not contain the allocation of most. So it can't be checked by us. But there are many candidates: boolArray and all arrays used inside the 'while (i < numHapticDevices)' loop (e.g. hapticDevices).
QuestionConvert to ASCII ? Pin
Vaclav_1-Aug-15 3:52
Vaclav_1-Aug-15 3:52 
AnswerRe: Convert to ASCII ? Pin
CPallini1-Aug-15 4:15
mveCPallini1-Aug-15 4:15 
AnswerRe: Convert to ASCII ? Pin
Richard MacCutchan1-Aug-15 4:33
mveRichard MacCutchan1-Aug-15 4:33 
GeneralRe: Convert to ASCII ? Pin
Vaclav_1-Aug-15 9:40
Vaclav_1-Aug-15 9:40 
GeneralRe: Convert to ASCII ? Pin
Richard MacCutchan1-Aug-15 21:00
mveRichard MacCutchan1-Aug-15 21:00 
GeneralRe: Convert to ASCII ? Pin
CPallini2-Aug-15 6:56
mveCPallini2-Aug-15 6:56 
QuestionEfficient way of converting an 8bit array of grayscale pixel data into 24bpp bitmap for GDI+? Pin
Kiran Satish31-Jul-15 8:39
Kiran Satish31-Jul-15 8:39 
QuestionRe: Efficient way of converting an 8bit array of grayscale pixel data into 24bpp bitmap for GDI+? Pin
CPallini31-Jul-15 21:40
mveCPallini31-Jul-15 21:40 
AnswerRe: Efficient way of converting an 8bit array of grayscale pixel data into 24bpp bitmap for GDI+? Pin
Jochen Arndt31-Jul-15 21:51
professionalJochen Arndt31-Jul-15 21:51 
GeneralPassing an "array" in C Pin
PIEBALDconsult31-Jul-15 7:41
mvePIEBALDconsult31-Jul-15 7:41 
GeneralRe: Passing an "array" in C Pin
k505431-Jul-15 7:55
mvek505431-Jul-15 7:55 
GeneralRe: Passing an "array" in C Pin
PIEBALDconsult31-Jul-15 8:34
mvePIEBALDconsult31-Jul-15 8:34 
SuggestionRe: Passing an "array" in C Pin
camycentsolutions2-Aug-15 19:36
camycentsolutions2-Aug-15 19:36 
GeneralRe: Passing an "array" in C Pin
Chris Losinger31-Jul-15 9:50
professionalChris Losinger31-Jul-15 9:50 
GeneralRe: Passing an "array" in C Pin
PIEBALDconsult31-Jul-15 10:48
mvePIEBALDconsult31-Jul-15 10:48 
GeneralRe: Passing an "array" in C Pin
PIEBALDconsult31-Jul-15 14:17
mvePIEBALDconsult31-Jul-15 14:17 
GeneralRe: Passing an "array" in C Pin
PIEBALDconsult1-Aug-15 21:18
mvePIEBALDconsult1-Aug-15 21:18 

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.