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

C / C++ / MFC

 
GeneralRe: Crashes in international version Pin
JWood27-Feb-05 9:34
JWood27-Feb-05 9:34 
GeneralMinidumps! Pin
jhwurmbach27-Feb-05 1:08
jhwurmbach27-Feb-05 1:08 
GeneralRe: Minidumps! Pin
JWood27-Feb-05 9:32
JWood27-Feb-05 9:32 
GeneralRe: Minidumps! Pin
jhwurmbach27-Feb-05 21:04
jhwurmbach27-Feb-05 21:04 
GeneralTab Cntrl String issue Pin
realloc26-Feb-05 4:46
realloc26-Feb-05 4:46 
GeneralRe: Tab Cntrl String issue Pin
Ravi Bhavnani26-Feb-05 5:20
professionalRavi Bhavnani26-Feb-05 5:20 
GeneralRe: Tab Cntrl String issue Pin
Michael Dunn26-Feb-05 6:04
sitebuilderMichael Dunn26-Feb-05 6:04 
GeneralRe: Tab Cntrl String issue Pin
realloc26-Feb-05 6:47
realloc26-Feb-05 6:47 
Thanks for the replies!

As it turned out, you were on the money with the mask member. This is my first forary into tab controls, and obviously misread the MSDN docs.


Michael Dunn wrote:
4. You're storing a TCITEM struct in a list, but the TCITEM contains a pointer to a char array on the stack. As soon as that array goes out of scope, the pointer becomes invalid.

Sorry for the confusion, I should have explained the snippet more clearly to avoid leading people down the wrong track. "list" is actually a ref to a vector passed in to the function.

so, in following everyones advice, I changed the struct definition to:

TC_ITEM tab = {0};
tab.mask = TCIF_TEXT | TCIF_PARAM | TCIF_IMAGE;
tab.dwState = 0;
tab.iImage = -1;
tab.pszText = (LPSTR)r->name.c_str();
tab.lParam = (LPARAM)r;
tab.cchTextMax = r->name.size() + 1;

this solved the display poblem, so my control is fully operational now.

Thanks for all the help, this board has been great!

Dave
GeneralRe: Tab Cntrl String issue Pin
Michael Dunn26-Feb-05 12:40
sitebuilderMichael Dunn26-Feb-05 12:40 
Generalnamespaces and libraries Pin
Anonymous26-Feb-05 2:21
Anonymous26-Feb-05 2:21 
GeneralRe: namespaces and libraries Pin
Michael Dunn26-Feb-05 4:32
sitebuilderMichael Dunn26-Feb-05 4:32 
GeneralPicture Tracking ... Not compilable to VS.NET 2005 Pin
x2bf326-Feb-05 0:28
x2bf326-Feb-05 0:28 
QuestionTo change the last-modified time of a file? Pin
Monisankar25-Feb-05 23:48
Monisankar25-Feb-05 23:48 
AnswerRe: To change the last-modified time of a file? Pin
David Crow26-Feb-05 3:23
David Crow26-Feb-05 3:23 
AnswerRe: To change the last-modified time of a file? Pin
Ravi Bhavnani26-Feb-05 4:27
professionalRavi Bhavnani26-Feb-05 4:27 
GeneralPerfect coders wanted (freelancers) Pin
PavelMenshikov25-Feb-05 23:44
PavelMenshikov25-Feb-05 23:44 
GeneralRe: Perfect coders wanted (freelancers) Pin
Ravi Bhavnani26-Feb-05 4:33
professionalRavi Bhavnani26-Feb-05 4:33 
GeneralRe: Perfect coders wanted (freelancers) Pin
alex.barylski26-Feb-05 10:24
alex.barylski26-Feb-05 10:24 
GeneralRe: Perfect coders wanted (freelancers) Pin
ThatsAlok27-Feb-05 20:17
ThatsAlok27-Feb-05 20:17 
Questionwhat are back pointers Pin
Girish60125-Feb-05 23:25
Girish60125-Feb-05 23:25 
AnswerRe: what are back pointers Pin
Maximilien26-Feb-05 1:28
Maximilien26-Feb-05 1:28 
GeneralRe: what are back pointers Pin
Girish60126-Feb-05 2:41
Girish60126-Feb-05 2:41 
GeneralReading/Writing from/to a device Pin
User 137680025-Feb-05 23:17
User 137680025-Feb-05 23:17 
QuestionHow to notice and stop new device Pin
atsuki25-Feb-05 22:44
atsuki25-Feb-05 22:44 
GeneralMySql / MFC VC++ Pin
_kane_25-Feb-05 21:58
_kane_25-Feb-05 21:58 

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.