Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++Windows
I needed to use application defined data for my tab control. MSDN says if the extra data exceeds 4 bytes I must use my own defined structure instead of TCITEM structure but that the first member of my defined structure must be a TCITEMHEADER structure. These I did. MSDN also specify that I must change the numner of extra bytes per tab by using TCM_SETITEMEXTRA message and that the extra byted should be the difference between the size of my structure and TCITEMHEADER structure. Also, I am supposed to be able to get and set my defined structure using TCM_GETITEM and TCM_SETITEM messages.
 
I have, to the best of my knowledge , done all this but debugging shows that the other members of my defines structure are neither being set nor got.Only the members of TCITEMHEADER structure are being set and got.I assigned the extra byte in WinMain just after I created the tab control.
 
What could be wrong?
Perhaps I am getting something wrong. How can I achieve my objective? By that I mean, how do I ensure that the extra bytes per tab is set?
How do I ensure the other members of my structure are set and got.
I noticed that the relevant functions accept pointer to TCITEM structure so I simply passed pointer to my user defined structure and casted it to TCITEM sructure pointer. Could this be the problem?
Posted 9-Jan-13 2:45am
Gbenbam770
Comments
Richard MacCutchan at 9-Jan-13 9:09am
   
You need to either use your debugger to trace through your code to see why it appears not to work, or show some of your code so that people can try and see what may be happening. Please edit your question and add some detail, not forgetting to put your code between <pre> tags.
nv3 at 9-Jan-13 9:41am
   
Make sure you specify TCIF_PARAM in the mask word of your TCM_ITEMHEADER derived structure.
Michael Haephrati at 3-Mar-13 14:11pm
   
Could you place here some of the source code in question?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Shai Vashdi 1,838
1 Tadit Dash 310
2 OriginalGriff 283
3 Sergey Alexandrovich Kryukov 260
4 Peter Leow 220
0 Sergey Alexandrovich Kryukov 9,440
1 OriginalGriff 5,618
2 Peter Leow 4,280
3 Maciej Los 3,540
4 Abhinav S 3,363


Advertise | Privacy | Mobile
Web04 | 2.8.140415.2 | Last Updated 9 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid