Click here to Skip to main content
15,887,083 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to catch TVM_DELETE or TVN_DELTEITEM from a custom tree control. Pin
Code-o-mat11-Jul-11 21:50
Code-o-mat11-Jul-11 21:50 
GeneralRe: How to catch TVM_DELETE or TVN_DELTEITEM from a custom tree control. Pin
Amrit Agr11-Jul-11 23:21
Amrit Agr11-Jul-11 23:21 
GeneralRe: How to catch TVM_DELETE or TVN_DELTEITEM from a custom tree control. Pin
Code-o-mat11-Jul-11 23:30
Code-o-mat11-Jul-11 23:30 
AnswerRe: How to catch TVM_DELETE or TVN_DELTEITEM from a custom tree control. Pin
Richard MacCutchan11-Jul-11 23:44
mveRichard MacCutchan11-Jul-11 23:44 
GeneralRe: How to catch TVM_DELETE or TVN_DELTEITEM from a custom tree control. Pin
Amrit Agr12-Jul-11 0:35
Amrit Agr12-Jul-11 0:35 
QuestionNeed to verify my RIFF file header construction - sample code wanted Pin
Vaclav_11-Jul-11 8:02
Vaclav_11-Jul-11 8:02 
AnswerRe: Need to verify my RIFF file header construction - sample code wanted Pin
Vaclav_11-Jul-11 8:42
Vaclav_11-Jul-11 8:42 
AnswerRe: Need to verify my RIFF file header construction - sample code wanted Pin
enhzflep11-Jul-11 16:09
enhzflep11-Jul-11 16:09 
I've had a similar sounding experience when writing out file-header structures in the past.
For me, the solution was as simple as checking that sizeof(my_header_struct) did indeed equal the correct size of the header struct. I found that it didn't and also found parts of it becoming misaligned.

After determining that the structure size was wrong, I found that the compiler was 'thoughtfully' padding the struct for me to a 4/8/16 byte multiple to make it quicker to access in memory. It was as simple as compiler directives to ensure that the struct was as specified and did not include this padding.

Using gcc, the relevant directives are:

#pragma pack(push, xxx)
#pragma pack(pop)
Where xxx is the size of the alignment block you'd like - i.e if xxx = 2 then the struct will be padded to a multiple of 2 bytes. For my use, xxx very nearly always = 1. Just place the first directive before the struct is defined and the second after it, you may place several structs between the directives if needed.

I don't know if this is/was the problem - digging through old code, I can remember that this was needed for BMP headers, and if memory serves me correctly - I also needed this when reading the sound samples from the old games Doom & Rott.

Cheers Smile | :)
GeneralRe: Need to verify my RIFF file header construction - sample code wanted Pin
Vaclav_11-Jul-11 17:28
Vaclav_11-Jul-11 17:28 
AnswerPARTIALLY SOLVED Need to verify my RIFF file header construction - sample code wanted Pin
Vaclav_12-Jul-11 16:23
Vaclav_12-Jul-11 16:23 
QuestionObtaining a list of what exceptions code can throw Pin
bob1697211-Jul-11 4:26
bob1697211-Jul-11 4:26 
AnswerRe: Obtaining a list of what exceptions code can throw Pin
Albert Holguin11-Jul-11 5:44
professionalAlbert Holguin11-Jul-11 5:44 
GeneralRe: Obtaining a list of what exceptions code can throw Pin
bob1697211-Jul-11 6:39
bob1697211-Jul-11 6:39 
GeneralRe: Obtaining a list of what exceptions code can throw Pin
Albert Holguin11-Jul-11 7:46
professionalAlbert Holguin11-Jul-11 7:46 
GeneralRe: Obtaining a list of what exceptions code can throw Pin
MicroVirus12-Jul-11 6:02
MicroVirus12-Jul-11 6:02 
QuestionHow to send TVN_BEGINLABELEDIT from a custom tree control Pin
Amrit Agr10-Jul-11 21:50
Amrit Agr10-Jul-11 21:50 
AnswerRe: How to send TVN_BEGINLABELEDIT from a custom tree control Pin
Richard MacCutchan10-Jul-11 22:13
mveRichard MacCutchan10-Jul-11 22:13 
AnswerRe: How to send TVN_BEGINLABELEDIT from a custom tree control Pin
User 742933810-Jul-11 22:21
professionalUser 742933810-Jul-11 22:21 
GeneralRe: How to send TVN_BEGINLABELEDIT from a custom tree control Pin
Amrit Agr10-Jul-11 22:59
Amrit Agr10-Jul-11 22:59 
QuestionHow can use Proxy Settings in VC++? Pin
Le@rner10-Jul-11 19:29
Le@rner10-Jul-11 19:29 
AnswerRe: How can use Proxy Settings in VC++? Pin
Cool_Dev10-Jul-11 20:50
Cool_Dev10-Jul-11 20:50 
GeneralRe: How can use Proxy Settings in VC++? Pin
Le@rner11-Jul-11 0:12
Le@rner11-Jul-11 0:12 
QuestionHow to send events to extended child control? Pin
rahul.kulshreshtha8-Jul-11 20:21
rahul.kulshreshtha8-Jul-11 20:21 
AnswerRe: How to send events to extended child control? Pin
Richard MacCutchan9-Jul-11 2:05
mveRichard MacCutchan9-Jul-11 2:05 
GeneralRe: How to send events to extended child control? Pin
rahul.kulshreshtha9-Jul-11 8:24
rahul.kulshreshtha9-Jul-11 8:24 

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.